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.