For my fighting system i need to handle input sequence.What the best way to do it in Defold?
For example i have different sequnces in game A-A-A(punch/punch/punch) A-A-B(punch/punch/kick)
I think i need to hadle input and pause between input. Because if player pressed too fast combination not work, and if player pressed too slow combination not work too.
I think about module that contains sequence of pressed buttons and pause between press.
1)In go script on every input.I add pressed button to module.
2)Then i check is it combination or not. If it combination i do all my work(change animation and etc).And wait next input.
3)On next input i add pause to sequence.
a)If pause too short i clear sequence.
b)If pause too big i clear sequence and add pressed button to sequence.
c)If pause is normal.I add pressed button to sequence.And continue my combination
Is it correct solution or there are some better solutuions?
What the best way to compare input(A-A-A) with combination list?To understand what combination user pressed?