-
Well, im making a game. Ive gotten the "character" to move left and right using the keyboard... but i want when you let go of the button your "character" slows to a stop... any help in this matter would be appreciated
-
instead of the arrows controlling the character directly, use them to set a speed value. like speed=10 or speed=-10 if the right/left keys are pressed.
then throw in some friction by reducing the speed by a small percentage each frame
speed*=.9;
and add the speed to the _x of you character
myguy._x+=speed;
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|