Page 1 of 1

Fighting Game Help

PostPosted: Sat Sep 27, 2014 11:59 am
by Rebenely
First of all, I want to say that I don't have any .ged files in here, but I think my question is kind of easy to understand.
I want my character do a simple punch.
So I create a key down event
Code: Select all
Key Down -> w -> ChangeAnimToSimplePunch


My problem is after that he keeps doing that animation until I press another key which would change my animation. What should I do to make the character do the animation once then stop?

Re: Fighting Game Help

PostPosted: Sat Sep 27, 2014 1:30 pm
by knucklecrunchgames
You could try to disable any keydown event until the animation is finished. I could send you a ged if you need one. (I'll try anyway)

Re: Fighting Game Help

PostPosted: Sat Sep 27, 2014 5:13 pm
by RippeR7420
You could use an Animation Finish event to change his animation back to standing once the punch animation is done.

But if you're making a fighting game its strongly recommended to use the switch(state) Method.
More info on it here viewtopic.php?f=1&t=13057&p=93664&hilit=state+case#p93664

Re: Fighting Game Help

PostPosted: Thu Oct 02, 2014 2:20 am
by bat78
If you one holded animation while keydown and full animation once on key up do this, its simple:

Player -> Draw Actor -> Script Editor:
Code: Select all
char *key = GetKeyState();

if(key[KEY_p])
{
    ChangeAnimation("Event Actor", "punch", FORWARD); // punch or w/e the animation is called
    ChangeAnimationDirection("Event Actor", STOPPED);
}
animpos++;
if(animpos == nframes) { ChangeAnimation("Event Actor", "idle", FORWARD); } // idle or the w/e is the idle animation called

Like that.. for me its more realistic.. som exotic controls.