Example #1
0
 public override void HandleInput(InputState input)
 {
     PlayerIndex playerIndex;
     if (input.IsMenuSelect(ControllingPlayer, out playerIndex))
     {
         if (Accepted != null)
             Accepted(this, new PlayerIndexEventArgs(playerIndex));
         ScreenManager.AddScreen(new BackgroundScreen(), null);
         ScreenManager.AddScreen(new MainMenuScreen(), null);
         ExitScreen();
     }
 }
Example #2
0
 public override void HandleInput(InputState input)
 {
     if (input.IsMenuUp(ControllingPlayer))
     {
         if(correctAnswer == 1)
         {
             parent.ProcessAnswer(true, lifeSpan);
         }
         else
         {
             parent.ProcessAnswer(false, 0);
         }
         ExitScreen();
     }
     else if (input.IsMenuDown(ControllingPlayer))
     {
         if(correctAnswer == 2)
         {
             parent.ProcessAnswer(true, lifeSpan);
         }
         else
         {
             parent.ProcessAnswer(false, 0);
         }
         ExitScreen();
     }
     else if(input.IsMenuLeft(ControllingPlayer))
     {
         if(correctAnswer == 3)
         {
             parent.ProcessAnswer(true, lifeSpan);
         }
         else
         {
             parent.ProcessAnswer(false, 0);
         }
         ExitScreen();
     }
     else if(input.IsMenuRight(ControllingPlayer))
     {
         if(correctAnswer == 4)
         {
             parent.ProcessAnswer(true, lifeSpan);
         }
         else
         {
             parent.ProcessAnswer(false, 0);
         }
         ExitScreen();
     }
 }
Example #3
0
        public override void HandleInput(InputState input)
        {
            PlayerIndex playerIndex;
            if (input.IsMenuSelect(ControllingPlayer, out playerIndex))
            {
                if (Accepted != null)
                    Accepted(this, new PlayerIndexEventArgs(playerIndex));

                ExitScreen();
            }
            else if (input.IsMenuCancel(ControllingPlayer, out playerIndex))
            {
                if (Cancelled != null)
                    Cancelled(this, new PlayerIndexEventArgs(playerIndex));

                ExitScreen();
            }
        }
Example #4
0
 public override void HandleInput(InputState input)
 {
     if (input.IsMenuUp(ControllingPlayer))
     {
         ProcessAnswer(1);
         ExitScreen();
     }
     else if (input.IsMenuDown(ControllingPlayer))
     {
         ProcessAnswer(4);
         ExitScreen();
     }
     else if(input.IsMenuLeft(ControllingPlayer))
     {
         ProcessAnswer(2);
         ExitScreen();
     }
     else if(input.IsMenuRight(ControllingPlayer))
     {
         ProcessAnswer(3);
         ExitScreen();
     }
 }
Example #5
0
        public override void HandleInput(InputState input)
        {
            if(input == null)
                throw new ArgumentNullException("input");

            int playerIndex = 0;
            if(ControllingPlayer.HasValue)
            {
                playerIndex = (int)ControllingPlayer.Value;
            }

            KeyboardState keyboardState = input.CurrentKeyboardStates[playerIndex];
            GamePadState gamePadState = input.CurrentGamePadStates[playerIndex];

            bool gamePadDisconnected = !gamePadState.IsConnected &&
                                       input.GamePadWasConnected[playerIndex];

            if(input.IsPauseGame(ControllingPlayer) || gamePadDisconnected)
            {
                ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
            }
        }
Example #6
0
 public virtual void HandleInput(InputState input)
 {
 }