Game Coding Complete, Fourth Edition by David Graham, Mike McShaffry

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 7CONTROLLING THE MAIN LOOP

by DavidRezGraham

image

Every game has a series of operations that run over and over to present and update the game to the player. This is the heartbeat that lets you know the game is alive. Games are unlike many forms of software in that even if the player does absolutely nothing, the game still needs to be constantly thinking and processing. A typical main loop may receive and process player input, run creature AI, update animations, update the physics system, run any world simulation that needs to happen, render the scene, and play music and sound effects. Every main loop is different and tailored for each individual ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required