예제 #1
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)
        {
            FMODManager.Update();
            UIController.Update();
            SceneController.Update();

            if (
                GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
                GamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed ||
                Keyboard.GetState().IsKeyDown(Keys.Escape)
                )
            {
                Exit();
            }

            base.Update(gameTime);
        }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            FMODManager.Update();

            Input.Update(gameTime);

            if (Input.IsKeyPressed(Keys.F11))
            {
                ScreenManager.ToggleFullScreen();
            }
            if (Input.IsKeyPressed(Keys.F4))
            {
                DebugMode = !DebugMode;
            }

            _currentScene?.Update(gameTime);

            base.Update(gameTime);
        }