Update() public method

public Update ( ) : void
return void
示例#1
0
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (Keyboard.GetState().IsKeyDown(Keys.F1) && !_lastState.IsKeyDown(Keys.F1))
            {
                _showDebugBoxes = !_showDebugBoxes;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.F2) && !_lastState.IsKeyDown(Keys.F2))
            {
                LevelScreen.HideFov = !LevelScreen.HideFov;
            }

            _delayedInput.Update(Keyboard.GetState());
            _mouseInput.Update(_graphics.GraphicsDevice.Viewport);
            _gameManager.Update();

            base.Update(gameTime);

            _lastState = Keyboard.GetState();
        }
示例#2
0
 protected override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     mouseInputHandler.Update();
     currentScene.Update();
 }