예제 #1
0
        protected override void Update(GameTime gameTime)
        {
            MouseState mouse = Mouse.GetState();

            if (gameManager.inputLock == false)
            {
                KeyboardManager.Update();
                puck.HandleCollision(playerStrikers, gameTime);// updates state for any keyboard manager
            }

            if (gameManager.currentState == GameManager.GameState.MainMenu)
            {
                if (playButton.isClicked == true)
                {
                    gameManager.currentState = GameManager.GameState.Playing;
                }
                playButton.Update(mouse);
                roomInput.Update(mouse);
            }
            else if (gameManager.currentState == GameManager.GameState.Options)
            {
            }
            else if (gameManager.currentState == GameManager.GameState.Playing)
            {
                playButton.isClicked = false;
            }

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }
            // TODO: Add your update logic here
            var kstate = Keyboard.GetState();

            playerOne.HandlePlayer(kstate, gameTime, puck);
            playerTwo.HandlePlayer(kstate, gameTime, puck);

            base.Update(gameTime);
        }