Special moves. The hadoken, dragon punch. unreal dash. etc.

From the street fighter games you get a the hadoken motion which is the motion, down, downforward, forward, and then press punch button… or if you think about unreal. double tapping a direction causes the player to dash.

The question. What is the smart way to register a special move?

Cause even if the player does the motion. If the motion wasn’t done at the proper speed. The special move won’t occur.

I’ll use a string to better explain it

each move you do adds to a string. Doing nothing for half a second clears the string, jumping clears the string (if you’re not already airbourne etc)…

So the string looks like: “D DR R SP” (down, downright right small punch) without duplicates, and so once you have a trimmed and smart string you just go:

if (moveString == “D DR R SP” || moveString == “D R SP”)
{
DoFireBall(0);
}

Remove duplicates from the string (or simply don’t add duplicate moves ie if you’re constantly moving right, your moveString should just only show “R”.

Several things cause the string to reset - For example if moving or jumping it will reset the string after say 0.2 seconds. Those things are usually tweaked so it “feels right”. While coding it, display the moves string on screen constantly and tweak the code for what feels right.

Lets look at dash: “R N R” (right, nothing, right). This would get through for a double tap, providing the timing for the string reset is tweaked well.

That sort of thing. I’ve done it before like this on the amiga, so its plenty fast and efficient (even with strings) on ios let alone anything else. There are no performance issues when it’s just one or two players doing it.

You’ll need to make sure the resulting string is always smartly formatted, and removes duplicates. Strings are preferred for debugging purposes and they make a lot of sense.

2 Likes

see: BSD - Button Sequence Detector (Combos)

1 Like