I was aiming to make a fighting game but I need help with the engine. So I searched for opensource fighting engines on TDC but I couldn't find any fighting games that made use of combos, special attacks whatsoever
Can anyone tell me how it's possible on MMF2?
I have the basic kick/punch thing ready but no combos or special attacks
One extremely simple way to do it is to have a counter. Say X is a basic attack and X > Y is a combo.
-Pressed X (and whatever other conditions are needed) > Make character attack; set counter to 5.
-Counter is greater than 0 > Subtract 1 from counter
-Pressed Y + Counter is greater than 0 + X attack animation is playing > combo attack.
I've never done this before, but that's one way to do in-sequence button combos. You may have to fiddle with the particulars to get it to work right.
I'd probably try storing the player input in a string, and then compare the string to your combination. You'd also need to constantly remove characters from the start of the string to force the player to press buttons quickly for a combo to work.
eg.
* Player presses "UP"
-> set string to string + "U"
* Player presses "DOWN"
-> set string to string + "D"
* Right(string, 3) = "UDU"
-> have player do what ever special you want to associate with "Up-Down-Up" combo
-> set string to ""
* Every < Some short space of time >
-> set string to Right(string, length of string - 1)
I've never tried it, but I don't see why it shouldn't work.