Пример #1
0
        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);
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        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);
        }