Game Development Reference
In-Depth Information
chapter 6
Game Structure
Now that the basics of the rendering are working, it's time to revisit game
architecture. Even small games ( Pong, for example) usually require a large amount
of code. Pong is a pretty simple game; the player moves a paddle left or right and
attempts to hit a ball past an opponent's paddle. It was one of the first popular
computer games released in 1987 so there have been numerous reimplementations
since then. SourceForge ( www.sourceforge.net) is a website that hosts hundreds of
thousands of open source projects. There are quite a few open source Pong clones,
and even the simplest ones are over 1,000 lines of code. As a game programmer, it's
important to have strategies to manage that complexity.
Big games are orders of magnitude more complex than Pong. Kelly Brock
revealed that there was a single function over 32,000 lines long in the Sims
computer game. This was posted in a discussion on the Software Development
for Games mailing list (a great list to join for any aspiring game programmer;
you can register to join on this website http://lists.midnightryder.com/listinfo.cgi/
sweng-gamedev-midnightryder.com). Games with strict deadlines and lots of
pressure can cause the code to become large and unmanageable. Being familiar
with some basic architecture techniques can help make code clearer and its
function more separated and defined.
The Basic Pattern of a Game Object
The majority of game objects need at least two functions: an update function
where the object can handle its animation or anything that changes over time,
 
 
 
Search WWH ::




Custom Search