Creating Different Game Modes

Learn how to create different game modes.

Games typically run in modes. Modes specify what the game should do on the current tick, displaying the main menu or the game-over screen, for example. In computer science, this is often formalized as a state machine. It’s a good idea to start by defining our game’s basic mode structure, which acts as an outline for the rest of the program.

Flappy Dragon requires three modes:

  1. Menu: The player is waiting at the main menu.

  2. Playing: The gameplay is in progress.

  3. End: The game is over.

Transitions between these modes are relatively straightforward:

Get hands-on with 1400+ tech skills courses.