Complex inputs for a fighting game or similar (SOLVED)

Many fighting games have complex input commands

Example: In the “Street fighter” game the player must input the command

< ↓ , → , Punch>

In order to perform the “haduken” technique.

Can these commands be done in defold ?
And if so how would the script be made ?

Thank you for reading

Interesting question. I would store input actions in a list and only accept actions coming with only a short interval between them. I’d then match the current sequence of actions against a list of supported sequences and if there’s a match the attack would be performed. I created an example to show what I mean:

CODE: https://github.com/britzl/publicexamples/tree/master/examples/fighter_combo
HTML5: http://britzl.github.io/publicexamples/fighter_combo/index.html

Available combos:

Z = Punch
DOWN, Z = Low Punch
UP, X = High Kick
DOWN, RIGHT, Z = Hadouken

3 Likes

This looks perfect, cant wait to add it to the sprite code.

Thank you for your help, it is very much appreciated
I can only imagine how much time and effort was used in getting the actual Ryu sprite and animating it. This is very well done :clap::clap::clap:

I still have many other questions regarding animations and character responses, but I will leave that for another day.

Thanks again

1 Like