Fighting Game Help

Talk about making games.

Fighting Game Help

Postby Rebenely » Sat Sep 27, 2014 11:59 am

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?
User avatar
Rebenely
 
Posts: 16
Joined: Fri Apr 05, 2013 1:13 pm
Score: 1 Give a positive score

Re: Fighting Game Help

Postby knucklecrunchgames » Sat Sep 27, 2014 1:30 pm

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)
User avatar
knucklecrunchgames
 
Posts: 1071
Joined: Wed Nov 21, 2012 8:01 pm
Location: In gameEditor.exe
Score: 17 Give a positive score

Re: Fighting Game Help

Postby RippeR7420 » Sat Sep 27, 2014 5:13 pm

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
Last edited by RippeR7420 on Thu Apr 23, 2015 2:52 pm, edited 1 time in total.
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: Fighting Game Help

Postby bat78 » Thu Oct 02, 2014 2:20 am

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.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron