Summary


This chapter presented the essentials of game program code design. In professional games, you define classes for each type of object you see on the screen. You implement each class in a .h and a .cpp file. The .h file contains the class definition and the inline member functions. The .cpp file contains the out-of-line member functions.

When speaking of the primary tasks that games perform, all game programs follow the same general design. They initialize the game, initialize a level, process messages in the main message loop, and update and render the frame. At the end of a level, they do any necessary level cleanup. At the end of the game, they perform whatever game cleanup is needed.

Unfortunately, Ping isn't a very exciting game because it has no sound or music. The next chapter demonstrates how to fix that.



Creating Games in C++(c) A Step-by-Step Guide
Creating Games in C++: A Step-by-Step Guide
ISBN: 0735714347
EAN: 2147483647
Year: N/A
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net