Problem with moving animation- please help me

Game Editor comments and discussion.

Problem with moving animation- please help me

Postby Luke playa » Tue Feb 20, 2007 5:14 pm

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".
Luke playa
 
Posts: 11
Joined: Tue Feb 20, 2007 4:50 pm
Location: USA
Score: 0 Give a positive score

Postby DilloDude » Tue Feb 20, 2007 11:54 pm

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.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Sgt. Sparky » Tue Feb 20, 2007 11:54 pm

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
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Luke playa » Wed Feb 21, 2007 12:23 pm

thanks guys!
Luke playa
 
Posts: 11
Joined: Tue Feb 20, 2007 4:50 pm
Location: USA
Score: 0 Give a positive score

Postby Sgt. Sparky » Wed Feb 21, 2007 6:34 pm

you are welcome :D
if you need more help for ANYTHING with GE,
just let me Know :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron