Пример #1
0
        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;
                }
            }
        }
Пример #2
0
        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();
        }
Пример #3
0
        //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;
        }
Пример #4
0
        private void goToGameScreen()
        {
            if (mTimer != null)
            {
                mTimer.stop();
                mTimer = null;
            }

            Game1.getInstance().getScreenManager().changeScreen(ScreenManager.SCREEN_ID_CHAR_SELECTION, true, true);
        }
Пример #5
0
        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);
        }