Applying the Game Logic and Updating the System

Game logic is generally defined as the internal decision-making code that makes a game function normally along some predetermined specification. It is the programming equivalent of the paper rules that come with board games. Game logic encompasses a wide array of programming concepts and includes development of artificial intelligence (AI) routines, collision detection, and several other aspects of game programming. Some of these topics will be discussed later in the chapter.

One of the most important things to do regarding game logic is to ensure that the rest of the game can access the newly adjudicated situation. For example, if a collision detection routine determines that a dangerous rock has collided with a laser ray and been destroyed, it is important that the game understands this rock has been destroyed and reacts accordingly. This rock should no longer be drawn on the screen and is not eligible for further collision detection. This process is referred to as updating the system. Many of these techniques result in automatic updating of the game to reflect these changes, but this update will not be seen until the next phase of the game’s operation has occurred.



Practical Java Game Programming
Practical Java Game Programming (Charles River Media Game Development)
ISBN: 1584503262
EAN: 2147483647
Year: 2003
Pages: 171

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