// === UPDATE === protected override void Update(GameTime gameTime) { // Player update _playerController.Update(gameTime, _player); _portalController.CollisionWithPlayer(gameTime, _player, _entryPortal, _exitPortal); base.Update(gameTime); CheckKeyboard(); }
protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } // Save the previous state of the keyboard and game pad so we can determine single key/button presses previousGamePadState = currentGamePadState; previousKeyboardState = currentKeyboardState; // Read the current state of the keyboard and gamepad and store it currentKeyboardState = Keyboard.GetState(); currentGamePadState = GamePad.GetState(PlayerIndex.One); UpdatePlayer(gameTime); pc.CollisionWithPlayer(player, entryPortal, exitPortal); }