EGameMode CMatch::Update (void) { // Increase elapsed time since mode has started m_ModeTime += m_pTimer->GetDeltaTime(); // If we have to make the first black screen if (m_ModeTime <= BLACKSCREEN_DURATION) { } // If the first black screen is done and we have to make a little // pause to allow the players to see the arena before playing else if (m_ModeTime <= BLACKSCREEN_DURATION + PAUSE_BEGIN) { } // If match is currently playing and it's not over else if (!m_MatchOver) { PlaySong (); //!< @see PlaySong() ProcessPlayerCommands (); //!< @see ProcessPlayerCommands() ManagePauseMessage (); //!< @see ManagePauseMessage() UpdateMatch (); //!< @see UpdateMatch() ManageHurryUpMessage (); //!< @see ManageHurryUpMessage() ManageMatchOver (); //!< @see ManageMatchOver() } // If the match is over and we have make a pause before the last black screen else if (m_ModeTime <= m_ExitModeTime) { // Update the match m_Board.Update (); m_Arena.Update (m_pTimer->GetDeltaTime()); } // If the pause is over and we have to make the last black screen else if (m_ModeTime <= m_ExitModeTime + BLACKSCREEN_DURATION) { } // If the last black screen is over then ask for another game mode else { // If it's a draw game if (m_WinnerPlayer == NO_WINNER_PLAYER) { // Ask for a game mode change to draw game screen return GAMEMODE_DRAWGAME; } // If there is a winner else { // Ask for a game mode change to winner screen return GAMEMODE_WINNER; } } // Stay in this game mode return GAMEMODE_MATCH; }
EGameMode CDemo::Update (void) { // Increase elapsed time since mode has started m_ModeTime += m_pTimer->GetDeltaTime(); // If we have to make the first black screen if (m_ModeTime <= BLACKSCREEN_DURATION) { } // If the first black screen is done and we have to make a little // pause to allow the players to see the arena before playing else if (m_ModeTime <= BLACKSCREEN_DURATION + PAUSE_BEGIN) { } // If match is currently playing and it's not over else if (!m_MatchOver) { PlaySong(); ProcessPlayerCommands(); ManageExit(); UpdateMatch(); UpdateDemoText(); ManageHurryUpMessage(); ManageMatchOver(); } // If the match is over and we have make a pause before the last black screen else if (m_ModeTime <= m_ExitModeTime) { m_Board.Update (); m_Arena.Update (m_pTimer->GetDeltaTime()); } // If the pause is over and we have to make the last black screen else if (m_ModeTime <= m_ExitModeTime + BLACKSCREEN_DURATION) { } // If the last black screen is over then ask for another game mode else { // Ask for a switch to the title screen return GAMEMODE_TITLE; } // Stay in this game mode return GAMEMODE_DEMO; }