March 2016
Beginner to intermediate
340 pages
6h 51m
English
Think about it. If we want our game to pause, then we have to set some kind of flag that tells the game that we want it to take a break. We could set up a Boolean:
bool m_isPaused;
We would set m_isPaused to true if the game is paused, and set it to false if the game is running.
The problem with this approach is that there are a lot of special cases that we may run into in a real game. At any time the game might be:
These are just some example of game states. A game state is a particular mode that requires special handling. As there can be so many states, we usually create a state manager to keep track of the state we are currently in.
The simplest version of a state manager begins ...
Read now
Unlock full access