Game Development Reference
In-Depth Information
o .Update( gameDeltaTime )
loop
// Generate outputs
foreach Drawable o in GameWorld.drawableObjects
o .Draw()
loop
// Frame limiting code
...
loop
This implementation is somewhat similar to what Microsoft uses in their XNA
framework, though the version presented here has been distilled to its essential
components.
Summary
This chapter covered three core concepts that are extremely important to any
game. The game loop determines how all the objects in the world are updated
everysingleframe.Ourmanagement oftimeiswhatdrivesthespeedofourgames
and ensures that gameplay can be consistent on a wide variety of machines. Fin-
ally, a well-designed game object model can simplify the update and rendering of
allrelevantobjectsintheworld.Combined,thesethreeconceptsrepresentthecore
building blocks of any real-time game.
Review Questions
1 . Why were early console games programmed in assembly language?
2 . What is middleware?
3 . Select a classic arcade game and theorize what it would need to do during
each of the three phases of the traditional game loop.
4 . In a traditional game loop, what are some examples of outputs beyond just
graphics?
5 . How does a basic multithreaded game loop improve the frame rate?
6 . What is input lag, and how does a multithreaded game loop contribute to
it?
Search WWH ::




Custom Search