Page 1 of 1

Problem with moving animation- please help me

PostPosted: Tue Feb 20, 2007 5:14 pm
by Luke playa
i have a big problem, the same game problem can be seen in the "Platform Game Tutorial", of the GE. If i press down the right key, my char move right, and Change Animation to make him walk right, and when I "Key up" (right), I Change the animation to "Stop Right". The same sistem for the left. but, when i hold down the keys "right" and "left", he stops. this is ok, but when i release one of the keys, the Char simply "slides" to the right or to the left... this happens because the current animation becomes "Stop right" or "Stop left", thanks to the key up event. HOW DO I SOLVE THIS PROBLEM?


PS: to see the problem by yourself, enter the GE, open the "Help" window, enter "Demo Making Of" and "Platform Game".

PostPosted: Tue Feb 20, 2007 11:54 pm
by DilloDude
Simple answer: on the key up, check that the other key is not down, and then change the animation. Otherwise, do nothing.You might want to do lots of fancy things for getting it to work right. Such as with the key down, constantly checking the animation.

PostPosted: Tue Feb 20, 2007 11:54 pm
by Sgt. Sparky
when the left or right key is released:
Code: Select all
xvelocity = 0;

for a better move see my perfect anti moonwalk near the middle of the page on:
http://game-editor.com/forum/tp-3039-Pe ... nwalk.html
:D

PostPosted: Wed Feb 21, 2007 12:23 pm
by Luke playa
thanks guys!

PostPosted: Wed Feb 21, 2007 6:34 pm
by Sgt. Sparky
you are welcome :D
if you need more help for ANYTHING with GE,
just let me Know :D