Roll around a platform, pick up coins, and do not fall off the edge. Clear the coins and the next level loads.
Game state
Everything runs through a game manager built on four states: playing, death, level complete, and game over. The update loop switches on the current state, which keeps every transition in one readable place instead of scattered across the objects.
The update function and its state switch.