Adding the Player

Learn how the player can move up and down by flapping its wings.

Activating the player

Now that the player is defined in the previous lesson, we need to add an instance of the Player to our game’s state and initialize them in the constructor. We also need a variable named frame_time (an f32). This tracks the time accumulated between frames to control the game’s speed.

Get hands-on with 1200+ tech skills courses.