Chapter 5. Diverting the Game Flow – State Stack
In the earlier chapters of this book, you have learned how to make an efficient program structure for a game, modern game loops, and data structures to contain a world with rich graphics. You also learned how to deal with user input, making it an interactive simulation. With the combination of all those pieces of knowledge, we can already make an interesting game experience. However, a game is usually more than that. A full blown product doesn't just open and let you play without an explanation, a menu, or a title screen. That is what is going to be covered in this chapter, the ability to make the game richer by adding different states and screens to it.
The main bits of knowledge to acquire throughout the chapter are as follows:
The state and the stack
Navigating between states
Moving our game into a state
The title screen as the entry point of the game
Our old friend, the main menu
Implementing an overlay pause screen
A simple example of a concurrent...