Instead of just checking if the ‘e’ key is pressed we now perform two checks:
- When it is first pressed we start the projectile animation.
- When the key is released we transition to the idle state.
You may have noticed that the player can still move while ‘shooting’ a projectile. Well, they can move while playing the projectile animation as we are yet to create the actual projectiles. For now, we want the player to be stationary while shooting, although this design decision may change as we playtest the game. To stop movement while shooting we’ll update C_KeyboardMovement by re-adding a reference to the animation component that we removed when we created the velocity component.