public override void HandleInput(InputManager input) { GamePadState gamePadState = input.CurrentGamePadState; bool gamePadDisconnected = !gamePadState.IsConnected && input.GamePadWasConnected; if (input.IsPauseGame() || gamePadDisconnected) { netManager.RemoteReady = false; netManager.SendPauseMessage(); ScreenManager.AddScreen(new PauseMenuScreen(this, netManager)); } //If we hit the button necessary to fire a fork, we need to create the sprite and //if we are playing networked, let the other person know if (input.IsShootFork()) { spriteManager.FireForks(); netManager.SendFireForkMessage(); } //We want to send the user our current position and rotation values however we do //not want to send too often or we clog up the network. To accomplish this, we only //send our current location/position when it is changing - the other player will //know our present state if we do not move netManager.SendLocation(spriteManager.player.getPosition, spriteManager.player.getRotation); }
public override void HandleInput(InputManager input) { if (input.IsMenuSelect()) { ScreenManager.AddScreen(new BackgroundScreen()); ScreenManager.AddScreen(new MainMenuScreen()); } }
public override void HandleInput(InputManager input) { GamePadState gamePadState = input.CurrentGamePadState; bool gamePadDisconnected = !gamePadState.IsConnected && input.GamePadWasConnected; if (input.IsPauseGame() || gamePadDisconnected) { ScreenManager.AddScreen(new PauseMenuScreen(this)); } //If we hit the button necessary to fire a fork, we need to create the sprite and //if we are playing networked, let the other person know if (input.IsShootFork()) { spriteManager.FireForks(); } }
public override void HandleInput(InputManager input) { if (input.IsMenuCancel()) { if (isNetworkGame) { foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers) { signedInGamer.Presence.PresenceMode = GamerPresenceMode.WaitingInLobby; } } ScreenManager.AddScreen(new BackgroundScreen()); ScreenManager.AddScreen(new MainMenuScreen()); ExitScreen(); } base.HandleInput(input); }
public override void HandleInput(InputManager input) { if (input.IsMenuSelect()) { // Raise the accepted event, then exit the message box. if (Accepted != null) Accepted(this, new PlayerIndexEventArgs()); ExitScreen(); } else if (input.IsMenuCancel()) { // Raise the cancelled event, then exit the message box. if (Cancelled != null) Cancelled(this, new PlayerIndexEventArgs()); ExitScreen(); } }
public override void HandleInput(InputManager input) { if (input.IsPauseGame()) { otherScreensAreGone = false; if (netManager.CurrentState == NetworkState.CreatedSession) netManager.CleanUpNetwork(); ScreenManager.AddScreen(new BackgroundScreen()); ScreenManager.AddScreen(new MainMenuScreen()); } base.HandleInput(input); }