Correct rapid movement...

Non-platform specific questions.

Correct rapid movement...

Postby Hyperyon » Sun Sep 10, 2006 12:44 am

My player changes animations at keydown events and keyup. When I press the keys fast the sprite moves even with a standing still position triggered from a keyup event. :? I couldnt find a similar topic... Is it possible to fix this?
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score

Postby Novice » Sun Sep 10, 2006 9:20 am

Post the events that you used and how you used them, so we can help you.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Jokke » Sun Sep 10, 2006 2:16 pm

you mean moonwalk? i get that too
Image
Jokke
 
Posts: 65
Joined: Sat Aug 26, 2006 11:53 am
Location: Yes
Score: 0 Give a positive score

Postby Hyperyon » Sun Sep 10, 2006 3:34 pm

events:

On player, add keydown event;
key right;
script editor: x=x+5;
change animation: walking sprite

add keyup;
key right;
change animation : standing sprite

same with up,left,down keys.

The sprite sometimes keeps its 'standing' position if I change the keys fast.
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score

Postby Novice » Sun Sep 10, 2006 5:27 pm

This happens because you press two keys at once and you have conflicting change animation codes to solve this you shoud use an if statement to check if other buttons are pressed. More about this is here
http://game-editor.com/forum/viewtopic. ... sc&start=0
it's quite a long topic so have patience.

BTW Makslane why dont the links in the forum work? and the url button is missing in the posting page.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Sun Sep 10, 2006 6:04 pm

Novice wrote:why dont the links in the forum work? and the url button is missing in the posting page.


Due a bug in the phpBB. Don't use the [url] tag in your posts. Just write the address like this: http://game-editor.com
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Novice » Mon Sep 11, 2006 2:30 pm

Thanks, that realy anoyed me. :D
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest