private void updateTimer(GameTime gameTime) { if (mTimer != null) { mTimer.update(gameTime); if (mTimer.getTimeAndLock(cEVENT_SECONDS)) { if (mActiveInsideButton) { mEventCompleted = true; mTimer.stop(); mTimer = null; } } } if (mTimerParalyzed != null) { mTimerParalyzed.update(gameTime); if (mTimerParalyzed.getTimeAndLock(0.6)) { mTimerParalyzed.stop(); mTimerParalyzed = null; mCanMove = true; } } }
public void update(GameTime gameTime) { manageEnemies(); if (mTimer != null) { mTimer.update(gameTime); if (mTimer.getTimeAndLock(mTimeIntervalBetweenEnemies)) { if (checkNext() != null) { checkNext().setReady(true); } mTimer.stop(); } } for (int x = 0; x < mGroup.getSize(); x++) { mGroup.getGameObject(x).update(gameTime); } garbageCollection(); }
//must be called while colliding with a button public void setActiveInsideButton(bool state) { //this AND is necessary to specify if the cursor is entering in the button if (mActiveInsideButton == false && state == true) { restartTimer(cEVENT_SECONDS); } mActiveInsideButton = state; if (mTimer != null) { mTimer.stop(); } //mTimer.Stop(); //mTimer.Enabled = false; }
private void goToGameScreen() { if (mTimer != null) { mTimer.stop(); mTimer = null; } Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_CHAR_SELECTION, true, true); }
private void goToMainMenu() { ObjectSerialization.Save <ProgressObject>(Game1.sPROGRESS_FILE_NAME, Game1.progressObject.setCurrentStage(1)); if (mTimer != null) { mTimer.stop(); mTimer = null; } mVideoPlayer.Stop(); Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_MAIN_MENU, true, true); }