The game loop is often called the heartbeat of a computer game, and indeed it is what gives life to our games. As a game is being played, inputs to the game, status, and outputs all need to proceed in a regular cycle. The game loop is the implementation of that cycle, so an efficient, high-performance game loop is essential for a playable computer game.
Computer games are all based on a cycle of operations. The typical steps in such a cycle include the following actions:
• Acquire input from the player.
• Update the game status as a result of user input.
• Update the game status as a result of time.
• Check for collisions among objects.
• Update objects based on game physics.
• Update the user ...