movement problem

Game Editor comments and discussion.

movement problem

Postby DarkParadox » Sat Aug 25, 2007 8:45 pm

on key down right i put xvelocity = xvelocity+4; and yet when i press right he moves like a centimeter and stops, whats the problem :?:
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: movement problem

Postby d-soldier » Sat Aug 25, 2007 8:48 pm

Try this code instead:
xvelocity=+4;

and make sure it's set to "repeat" while keydown.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Re: movement problem

Postby DarkParadox » Sat Aug 25, 2007 9:06 pm

that worked thanks
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: movement problem

Postby J Maker » Sun Aug 26, 2007 1:58 am

i use:
Code: Select all
x=x+5;//right and repeat

Code: Select all
x=x-5;//left and repeat

but dsd's code should work but wouldn't keep going after the key is let go of (key up) mine does i know that for sure.
i've also encountered a moving problem, if i use velocities to move on a side scroller or top down, if my player's moving let's say right, and he collides with the top or bottom of a square he just stops
Some people believe Chuck Norris evolved from a dinosaur, the Chucknorisaurus.
----------------------------------------------------------------------------------
Chuck Norris doesn't sleep, he waits.
----------------------------------------------------------------------------------
Chuck Norris doesn't hunt, he kills.
----------------------------------------------------------------------------------
Chuck Norris once shot down a german fighter plane with his finger by yelling BANG!!!
----------------------------------------------------------------------------------
User avatar
J Maker
 
Posts: 177
Joined: Fri Jun 22, 2007 4:17 pm
Location: in the stick version of Hyrule
Score: 10 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron