Game Development Reference
In-Depth Information
}
}
}
return TotalKillValue;
}
The RenderArenaObjects() function renders all the arena objects in the set m_ArenaObjectSet array
that are valid objects that are not null. (See Listing 10-15.)
Listing 10-15. Rendering the ArenaObject Set
void RenderArenaObjects(Camera Cam, PointLight Light, boolean DebugOn)
{
for (int i = 0; i < MAX_ARENA_OBJECTS; i++)
{
if (m_ArenaObjectSet[i] != null)
{
m_ArenaObjectSet[i].RenderArenaObject(Cam, Light);
}
}
}
The UpdateArenaObjects() function updates all the valid arena objects in the set. (See Listing 10-16.)
Listing 10-16. Updating the ArenaObject Set
void UpdateArenaObjects()
{
for (int i = 0; i < MAX_ARENA_OBJECTS; i++)
{
if (m_ArenaObjectSet[i] != null)
{
m_ArenaObjectSet[i].UpdateArenaObject();
}
}
}
The TankFleet Class
The TankFleet class holds a group of tank objects and contains functions to help manage and
manipulate the fleet of tanks. There are many similarities between the TankFleet class and the
ArenaObjectSet class, so I will only cover functions in the TankFleet class here that are substantially
different or important.
The MAX_TANKS variable holds the maximum number of tanks that can be held in this set.
private int MAX_TANKS = 5;
The m_TankFleet array holds the tank objects for this set.
private Tank[] m_TankFleet = new Tank[MAX_TANKS];
 
Search WWH ::




Custom Search