Esempio n. 1
0
 public void HandleInput(GameTime gameTime)
 {
     if (_current != null)
     {
         _current.HandleInput(gameTime);
     }
     _gameStateManager.HandleInput(gameTime);
 }
        protected virtual void HandleInput()
        {
            inputHelper.Update();

            if (inputHelper.KeyPressed(Keys.Escape))
            {
                Exit();
            }
            if (inputHelper.KeyPressed(Keys.F5))
            {
                FullScreen = !FullScreen;
            }

            GameStateManager.HandleInput(inputHelper);
        }
Esempio n. 3
0
        /// <summary>
        /// Performs basic input handling and then calls HandleInput for the entire game world.
        /// </summary>
        protected void HandleInput()
        {
            inputHelper.Update();

            // quit the game when the player presses ESC
            if (inputHelper.KeyPressed(Keys.Escape))
            {
                Exit();
            }

            // toggle full-screen mode when the player presses F5
            if (inputHelper.KeyPressed(Keys.F5))
            {
                FullScreen = !FullScreen;
            }

            GameStateManager.HandleInput(inputHelper);
        }