Game Development Reference
In-Depth Information
Listing 10-48. Updating the Game
void UpdateScene()
{
m_Camera.UpdateCamera();
// Main Menu
if (m_GameState == GameState.MainMenu)
{
m_MainMenu.UpdateMenu(m_Camera);
return;
}
// High Score Table
if (m_GameState == GameState.HighScoreTable)
{
m_HighScoreTable.UpdateHighScoreTable(m_Camera);
return;
}
// High Score Entry
if (m_GameState == GameState.HighScoreEntry)
{
// Update HighScore Entry Table
m_HighScoreEntryMenu.UpdateHighScoreEntryMenu(m_Camera);
return;
}
// Game Over Screen
if (m_GameState == GameState.GameOverScreen)
{
// Update Game Over Screen Here
UpdateGameOverBillBoard();
m_GameOverBillBoard.UpdateObject3d(m_Camera);
return;
}
// Check if Game has ended and go to
if (m_Pyramid.GetObjectStats().GetHealth() <= 0)
{
m_GameState = GameState.GameOverScreen;
m_GameOverStartTime = System.currentTimeMillis();
// Game is over cannot continue current game.
m_CanContinue = false;
}
// Process the Collisions in the Game
ProcessCollisions();
 
Search WWH ::




Custom Search