ComboMoves using the same key multiple times

Theoretical issue here.

Suppose I had an attack had 3 parts to it, each triggered by hitting “e”. If hit once, the first part of the attack occurs. If hit twice, the first and second will play together, and will be played according to how much time was in between the two hits (before the first one finishes though). And hitting 3 times will play all 3 attacks, with the same constraint in mind.

How should I create the combo moves, and there some way the animation for the attacks should be prepared as well. I currently have 3 separate animations and can do the first attack just fine (it’s just hitting the attack button, didn’t even need a combo move if I wanted), but I can’t figure out how I should be coding the other two to create the desired attacks.

Set a flag to say the combo is in force or not.

Listen for the first animation finishing (using an animation listener) and then trigger the next animation based on what flags are set.

1 Like

Good idea. I never thought of using the animation listener in the control in tandem with the combo moves. That works quite well, and was a pretty simple solution. Thanks zarch.

:slight_smile: Simple is good in (nearly) any programming situation :slight_smile: