Update() public method

public Update ( ) : void
return void
Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            PerformanceManager.StartStopwatch(PerformanceStopwatchType.GlobalFrame);

            PerformanceManager.StartStopwatch(PerformanceStopwatchType.GlobalUpdate);

            HandleKeyboardInputs();

            base.Update(gameTime);

            if (Pause && !_computeNextFrame)
            {
                return;
            }

            MusicManager.Update(gameTime);

            Camera.Update(gameTime);

            ScreenManager.Update(gameTime);

            GuiManager.Update(gameTime);

            SpriteBatchManager.Update(gameTime);

            GameManager.Update(gameTime);

            PerformanceManager.StartStopwatch(PerformanceStopwatchType.PerformanceManagerUpdate);
            PerformanceManager.Update(gameTime);
            PerformanceManager.StopStopwatch(PerformanceStopwatchType.PerformanceManagerUpdate);

            PerformanceManager.StopStopwatch(PerformanceStopwatchType.GlobalUpdate);
        }
    /// <summary>
    /// Allows the game to run logic such as updating the world,
    /// checking for collisions, gathering input, and playing audio.
    /// </summary>
    /// <param name="gameTime">Provides a snapshot of timing values.</param>
    protected void Update(GameTime gameTime)
    {
        // Allows the game to exit
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
            exitGame)
        {
            this.Exit();
        }

        if (GamePad.GetState(PlayerIndex.One).Triggers.Right > 0.00001f)
        {
            _zoom = 1.5f;
        }

        if (GamePad.GetState(PlayerIndex.One).Triggers.Left > 0.00001f)
        {
            _zoom = 1f;
        }

        cam.UpdateCameraZoom(_zoom, gameTime);
        bloom.UpdateBloom(bloomIntensityIndex, gameTime);
        InputHelper.UpdateStates();
        GameManager.Update(gameTime);
        SoundManager.Update();
        MusicManager.Update();

        base.Update(gameTime);
    }
Exemplo n.º 3
0
    public override void Updated()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            SceneManager.sceneMgr.ChangeScene(SceneState.DIFFICULTY);
        }

        musicMgr.Update();
    }
Exemplo n.º 4
0
        public void Update()
        {
            if (mStatus == PlayerStatus.Playing)
            {
                mTime++;
            }
            mMainCharacter.ControllerState = mGame.ControllerA;

            mMusicManager.Update();
        }
Exemplo n.º 5
0
        public static void Update(GameTime gameTime)
        {
            GameTime = gameTime;

            KeyBoardHandler.Update();
            ControllerHandler.Update();

            BaseConnectScreen.UpdateConnectSet();

            if (!GameInstance.IsActive)
            {
                if (CurrentScreen.CanBePaused)
                {
                    Core.SetScreen(Screen.CreatePauseScreen(CurrentScreen));
                }
            }
            else
            {
                if (KeyBoardHandler.KeyPressed(KeyBindings.Escape) || ControllerHandler.ButtonDown(Buttons.Start))
                {
                    CurrentScreen.EscapePressed();
                }
            }

            CurrentScreen?.Update(gameTime);
            if (CurrentScreen.CanChat)
            {
                if (KeyBoardHandler.KeyPressed(KeyBindings.Chat) || ControllerHandler.ButtonPressed(Buttons.RightShoulder))
                {
                    if (BaseJoinServerScreen.Online || Player.SandBoxMode || GameController.IS_DEBUG_ACTIVE)
                    {
                        SetScreen(Screen.CreateChatScreen((CurrentScreen)));
                    }
                }
            }

            MainGameFunctions.FunctionKeys();
            MusicManager.Update(gameTime);

            GameMessage.Update();
            Controls.MakeMouseVisible();

            MouseHandler.Update();

            LoadingDots.Update();
            ForcedCrash.Update();

            ServersManager.Update();
        }
Exemplo n.º 6
0
        protected override void Update(GameTime gameTime)
        {
            KeyMouseReader.Update();
            Variables.Update();

            TotalScore = KillBonus + HealthBonus + LevelBonus;

            MusicManager.Update(gameTime);
            switch (GameState)
            {
            case GameStateEnum.MainMenu:
                MainMenuManager.Update(gameTime);
                break;

            case GameStateEnum.GameActive:
                GamePlayManager.Update(gameTime);
                break;

            case GameStateEnum.HighScoreView:
                HighScoreDisplay.Update(gameTime);
                break;

            case GameStateEnum.Story:
                StoryMode.Update(gameTime);
                break;

            case GameStateEnum.GameOver:
                GameOverManager.Update(gameTime);
                break;

            case GameStateEnum.Pause:
                PauseManager.Update(gameTime);
                break;

            case GameStateEnum.MapMaker:
                MapMakerManager.Update(gameTime);
                break;

            case GameStateEnum.LevelSelector:
                LevelSelectorManager.Update(gameTime);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            ButtonManager.Update(gameTime);
            base.Update(gameTime);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (_oldState.IsKeyDown(Keys.M) && Keyboard.GetState().IsKeyUp(Keys.M) && Keyboard.GetState().IsKeyDown(Keys.LeftControl))
            {
                MediaPlayer.IsMuted = !MediaPlayer.IsMuted;
            }

            if (_oldState.IsKeyDown(Keys.F1) && Keyboard.GetState().IsKeyUp(Keys.F1))
            {
                _musicManager.FadeOut();
            }

            if (_oldState.IsKeyDown(Keys.F2) && Keyboard.GetState().IsKeyUp(Keys.F2))
            {
                _musicManager.FadeIn();
            }

            _themeManager.Update(gameTime);
            _musicManager.Update(gameTime);
            _screenManager.Update(gameTime);

            _oldState = Keyboard.GetState();
        }
Exemplo n.º 8
0
 public void Update()
 {
     musicManager.Update();
     fxManager.Update();
 }
Exemplo n.º 9
0
 protected override void OnUpdate(GameTime gameTime)
 {
     musicManager.Update(gameTime);
     onbeat = musicManager.CheckBeat();
     base.OnUpdate(gameTime);
 }