attacking animations

Non-platform specific questions.

attacking animations

Postby DollMaster » Wed Mar 14, 2007 5:29 am

I have made it so that when the hero walks, if you press left and right at the same time and let one go prematurely, he will not do a moonwalk. However, now that I want him to do more than walk I am having problems with the animations.

I have a keydown for LEFT and RIGHT event to make him not moonwalk:
ChangeAnimation("Event Actor", "stand", FORWARD);
x+=0;
y+=0;
move=0;
//with a key up event:
if(move==0)
{
ChangeAnimation("Event Actor", "walkL", FORWARD);
move=1;
}

else if(move==1)
{
ChangeAnimation("Event Actor", "standR", FORWARD);
}



When I press the right shift, I have the guy punching:
if(herodir==1){ChangeAnimation("Event Actor", "punchRB", FORWARD);
CreateActor("swing", "swingR", "no parent", "no path", 5, 0, false);}
else if(herodir==2){ChangeAnimation("Event Actor", "punchLB", FORWARD);
CreateActor("swing", "swingL", "no parent", "no path", -5, 0, false);}

My problems,
1)If you try to walk while punching, and then stop punching, while continueing walking he will slide accross the floor. This is the standing animation, and not the walking one.

2)I want him to not be able to move while he punches.

I copied the keydown events from game a gogo's cross platform demo.
DollMaster
 
Posts: 65
Joined: Fri Jun 16, 2006 2:38 am
Score: 2 Give a positive score

Postby makslane » Wed Mar 14, 2007 10:32 pm

You can use the 'Wait for frame' option and execute the action at rith frame of the punche animation.

Look the Fairy demo:
http://game-editor.com/games/fairy.zip
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest