I want to emulate this behavior of fighting games:
When the player hits the attack button,
1) the avatar plays a starting animation (during which frames the player is vulnerable)
2) then the player performs the hitting animation (during which frames, the player is inflicting damage)
3) then the player performs the cool down animation (during which frames, the player is vulnerable, and cannot attack).
The starting animation might be 8 frames long, the hitting 10 frames long, and the cool down 12 frames long.
I?m a little stuck in the implementation. My first theory was to do this:
<img src="http://s15.postimg.org/cipnfx20r/Screenshot_10.png" border="0" />
but that doesn?t work.