Exemple #1
0
        public override void HandleInput(inputState input)
        {
            if (input.isMenuUp(thisPlayer))
            {
                selected--;

                if (selected < 0)
                {
                    selected = menuEntries.Count - 1;
                }
            }

            if (input.isMenuDown(thisPlayer))
            {
                selected++;

                if (selected >= menuEntries.Count)
                {
                    selected = 0;
                }
            }

            PlayerIndex pIndex;

            if (input.isSelect(thisPlayer, out pIndex))
            {
                OnSelectEntry(selected, pIndex);
            }
            else if (input.isCancel(thisPlayer, out pIndex))
            {
                OnCancel(pIndex);
            }
        }
Exemple #2
0
        public override void HandleInput(inputState input)
        {
            KeyboardState keyboardState = input.currentKeyboardState;
            GamePadState  gamePadState  = input.currentGamePadState;

            if (input.isPause(thisPlayer))
            {
                SManager.AddScreen(new PauseMenu(), thisPlayer);
            }
        }
Exemple #3
0
        public override void HandleInput(inputState input)
        {
            KeyboardState keyboardState = input.currentKeyboardState;
            GamePadState  gamePadState  = input.currentGamePadState;

            if (input.isPause(thisPlayer))
            {
                SManager.AddScreen(new PauseMenu(), thisPlayer);
            }

            if (keyboardState.IsKeyDown(Keys.Space) || gamePadState.Triggers.Right > 0)
            {
                playerShoot();
            }

            if (keyboardState.IsKeyDown(Keys.Left) || gamePadState.ThumbSticks.Right.X < 0)
            {
                if (pSprite.getRotation() < -1.2)
                {
                    pSprite.rotation = (float)-1.2;
                }
                else
                {
                    pSprite.rotation -= 0.05f;
                }
            }

            if (keyboardState.IsKeyDown(Keys.Right) || gamePadState.ThumbSticks.Right.X > 0)
            {
                if (pSprite.getRotation() > 1.2)
                {
                    pSprite.rotation = (float)1.2;
                }
                else
                {
                    pSprite.rotation += 0.05f;
                }
            }
        }
Exemple #4
0
 public virtual void HandleInput(inputState input)
 {
 }