コード例 #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)
        {
            //if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            //    Exit();

            // TODO: Add your update logic here
            CONTENT_MANAGER.inputState = new InputState(Mouse.GetState(), Keyboard.GetState());

            if (HelperFunction.IsKeyPress(Keys.F1))
            {
                SCREEN_MANAGER.goto_screen("TestAnimationScreen");
            }

            if (HelperFunction.IsKeyPress(Keys.F2))
            {
                Unit.Load();
                CONTENT_MANAGER.ShowMessageBox("Unit stats reloaded");
            }

            if (HelperFunction.IsKeyPress(Keys.F3))
            {
                SCREEN_MANAGER.goto_screen("TestConsole");
            }

            SCREEN_MANAGER.Update(gameTime);

            lastInputState = inputState;
            base.Update(gameTime);
        }
コード例 #2
0
        protected override void Update(GameTime gameTime)
        {
            CONTENT_MANAGER.CurrentInputState = new InputState(Mouse.GetState(), Keyboard.GetState());

            SCREEN_MANAGER.Update(gameTime);

            base.Update(gameTime);
        }
コード例 #3
0
        protected override void Update(GameTime gameTime)
        {
            //if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            //	Exit();

            CONTENT_MANAGER.CurrentInputState = new InputState(Mouse.GetState(), Keyboard.GetState());

            SCREEN_MANAGER.Update(gameTime);

            base.Update(gameTime);
        }