Game Development Reference
In-Depth Information
Chapter 10
The Final Drone Grid Game
This chapter covers the final Drone Grid game. I start off by covering classes that are needed to help
manage enemy objects in the game. The GamePlayController class, which controls elements such
as what types of enemies are added to the playfield, is then discussed. Next, code modifications and
new functions that save and load the state of the game are covered. This is followed by a discussion
on implementing a game over graphic and game over state code into the Drone Grid game. Finally,
a hands-on example is covered that demonstrates the concepts and classes discussed previously in
the chapter.
Organizing and Controlling Groups of Enemies
For our final game, we will require some support classes that make the manipulation of our enemy
objects easier. The two classes we will need are the ArenaObjectSet class, which controls our arena
object enemies, and the TankFleet class, which controls our tank object enemies.
The ArenaObjectSet Class
The ArenaObjectSet class holds a group of arena objects and has functions that manage these
objects.
The MAX_ARENA_OBJECTS variable holds the maximum number of arena objects that this set will hold.
private int MAX_ARENA_OBJECTS = 25;
The m_NumberArenaObjects variable holds the actual number of arena objects in the set.
private int m_NumberArenaObjects = 0;
The m_ArenaObjectSet variable array holds the set of arena objects that will be used in this class.
private ArenaObject3d[] m_ArenaObjectSet = new ArenaObject3d[MAX_ARENA_OBJECTS];
353
 
Search WWH ::




Custom Search