#47507 - QuantumDoja - Sat Jul 09, 2005 10:04 pm
Hi, I have a button sequence that i want to detect for a special move, much like street fighter or tekken.
Example: Up, Down, Left, A + B
Example: Up + R, Down + L, A, B
I have this post: http://forum.gbadev.org/viewtopic.php?t=4128&highlight=button+combo
is this the right lines to code, having 1 function per combo?
I want something like [pseudo] - but if i have 32 special combos, it will have to check each one - maybe slow.
_________________
Chris Davis
Example: Up, Down, Left, A + B
Example: Up + R, Down + L, A, B
I have this post: http://forum.gbadev.org/viewtopic.php?t=4128&highlight=button+combo
is this the right lines to code, having 1 function per combo?
I want something like [pseudo] - but if i have 32 special combos, it will have to check each one - maybe slow.
Code: |
//Up + R, Down + L, A, B if (button_Up pressed && button_R pressed) { then if (button_down pressed && button_L pressed) { then if (button_a pressed) { then if (button_b pressed) { do combo xyz } } } } |
_________________
Chris Davis