public override void HandleInput(InputState input) { if (input == null) throw new ArgumentNullException("input"); // Look up inputs for the active player profile. int playerIndex = (int)ControllingPlayer.Value; KeyboardState keyboardState = input.CurrentKeyboardStates[playerIndex]; GamePadState gamePadState = input.CurrentGamePadStates[playerIndex]; // The game pauses either if the user presses the pause button, or if // they unplug the active gamepad. This requires us to keep track of // whether a gamepad was ever plugged in, because we don't want to pause // on PC if they are playing with a keyboard and have no gamepad at all! bool gamePadDisconnected = !gamePadState.IsConnected && input.GamePadWasConnected[playerIndex]; if (input.IsPauseGame(ControllingPlayer) || (input.IsMenuB(ControllingPlayer))) { PowerHourGame.mSound.Play(Sound.SoundFX.button); ScreenManager.RemoveScreen(this); } else { } }
/// <summary> /// Lets the game respond to player input. Unlike the Update method, /// this will only be called when the gameplay screen is active. /// </summary> public override void HandleInput(InputState input) { if (input == null) throw new ArgumentNullException("input"); // Look up inputs for the active player profile. int playerIndex = (int)ControllingPlayer.Value; if ((input.IsPauseGame(ControllingPlayer)) || (input.IsMenuB(ControllingPlayer))) { PowerHourGame.mSound.Play(Sound.SoundFX.button); ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer); } else if(input.IsMenuY(ControllingPlayer)) { PowerHourGame.mSound.Play(Sound.SoundFX.can_2); ScreenManager.AddScreen(new DiscMenuScreen(), ControllingPlayer); } else if (input.IsMenuA(ControllingPlayer)) { //animationPlaybackMode += 1; } else if (input.IsMenuLeft(ControllingPlayer)) { c--; } else if (input.IsMenuRight(ControllingPlayer)) { c++; } }