Adding the controls
It is fairly common in a dash game such as this to have very simple controls. Often the player must only press the screen for jumping. But we spiced things up a bit, adding a floating state.
And remember we want smooth transitions between states, so pay attention to how jumping is implemented: not by immediately applying a force to the player's vector but by simply changing a boolean
property and letting the _player
object's update method handle the change smoothly.
We'll handle the touch events next.