Game Development Reference
In-Depth Information
Modifying the MyGLRenderer Class
The m_GamePlayController variable holds a reference to the GamePlay Controller for this game.
private GamePlayController m_GamePlayController;
The ARENA_OBJECTS_HANDLE string holds the name of the handle that the set of arena objects is
saved under.
private String ARENA_OBJECTS_HANDLE = "ArenaObjectsSet";
The TANK_FLEET_HANDLE string holds the name of the handle that the fleet of tanks is saved under.
private String TANK_FLEET_HANDLE = "TankFleet";
The m_ArenaObjectsSet variable holds a reference to the set of arena objects that will be used in
this game.
private ArenaObjectSet m_ArenaObjectsSet;
The m_TankFleet variable holds a reference to the fleet of tanks that will be used in this game.
private TankFleet m_TankFleet;
The k_SecondsPerTick variable holds the time in milliseconds for each tick or update to the game.
This variable is used to help update the game at a constant rate.
private float k_SecondsPerTick = 0.05f * 1000.0f/1.0f; // milliseconds 20 frames /sec
The m_ElapsedTime variable holds the time that has passed since the last update to the game.
private long m_ElapsedTime = 0;
The m_CurrentTime variable holds the current time in milliseconds.
private long m_CurrentTime = 0;
The m_UpdateTimeCount variable is used in keeping track of the number of updates that are needed in
the game, based on the elapsed time since the last update.
private long m_UpdateTimeCount = 0;
The m_TimeInit variable is true if the frame update timing control-related variables have been
initialized and false otherwise.
private boolean m_TimeInit = false;
The CreateArenaObjectsSet( ) function creates the ArenaObject set for the game and fills it with two
arena objects. The new arena objects are added by calling the AddNewArenaObject() function.
(See Listing 10-43.)
 
Search WWH ::




Custom Search