示例#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)
        {
            MouseInput.Update();
            KeyboardInput.Update();
            // TODO: Add your update logic here
            MouseManager.Update(gameTime);
            if (_sceneCurrent == null)
            {
                switch (_state)
                {
                case State.QUIT:
                    Exit();
                    break;

                case State.MAIN_MENU:
                    _sceneCurrent = new SceneMainMenu();
                    break;

                case State.PLAY:
                    _sceneCurrent = new ScenePlay();
                    break;

                case State.TEST_MAP:
                    _sceneCurrent = new SceneTestMap();
                    break;
                }
                _sceneCurrent.LoadContent(Content);
            }
            else
            {
                _sceneCurrent.Update(gameTime);
            }


            base.Update(gameTime);
        }
示例#2
0
 private void RegisterKeyboardKeys()
 {
     KeyboardInput.AddKey(Keys.Escape);
     KeyboardInput.AddKey(Keys.E);
 }