Hi,
This is a typical problem that you will only be able to solve using a timer.
same thing for double click, you can't expect to catch a double click without a timer, here you want to know before you fire any single key stroke, if yindeed ou have a combo ( Up-Left).
So, the easiest way, if you are not too keen on complex dynamic fsms, you hard code your combo in your fsm logic.
start with a axis event, you catch all of them, and each goes to a specific state, that then only listen to the potential combo, with a timer to exit that state, which would lead to trigger the initial event.
example:
state 1: listen to all events
-- left key is fired - go to state "Left key"
state "Left key", only listen to up and down events, with a third action with a timer of 0.2 s, leading to a state firing the LEFT animation. if up or down key is hit before the timer, you fire the left-up anim or the left-down anim.
does that make sense?
for the braves, you can do all this dynamically, using ArrayMaker, with an arrayList per combo, and on each key stroke you check what array current index matches the key and move the current index to the next item and watch for this one, once the array has no more items, it means this combo was performed. I have done this for morse code
so one could make a game where the player had to do various morse to progress, which meant not a real possibility to hardcode each morse code in an fsm.
Bye,
Jean