Controlling Gamestate
Virtually all programs have this, a central ‘game’ loop that grabs user input, updates game logic, redraws the screen. At it’s simplest possible level, it usually looks something like this: repeat Input; Update; Redraw; until Quit; The problem mainly comes in that middle section, Update. For any game, there are a variety of different states