当前位置: 首页>>代码示例>>C#>>正文


C# InputState.IsPauseGame方法代码示例

本文整理汇总了C#中GameStateManagement.InputState.IsPauseGame方法的典型用法代码示例。如果您正苦于以下问题:C# InputState.IsPauseGame方法的具体用法?C# InputState.IsPauseGame怎么用?C# InputState.IsPauseGame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameStateManagement.InputState的用法示例。


在下文中一共展示了InputState.IsPauseGame方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleInput

        public override void HandleInput(InputState input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            //Go back to the previous screen if the player presses the back button
            if (input.IsPauseGame(null))
            {
                Exit();
            }

            // Return to the main menu when a tap gesture is recognized
            if (input.Gestures.Count > 0)
            {
                GestureSample sample = input.Gestures[0];
                if (sample.GestureType == GestureType.Tap)
                {
                    Exit();

                    input.Gestures.Clear();
                }
            }
        }
开发者ID:nganthony,项目名称:Space-Catch,代码行数:25,代码来源:TutorialScreen.cs

示例2: HandleInput

        /// <summary>
        /// Handle user input.
        /// </summary>
        /// <param name="input">User input information.</param>
        public override void HandleInput(InputState input)
        {
            if (input.IsPauseGame(null))
            {
                PauseCurrentGame();
            }

            base.HandleInput(input);
        }
开发者ID:Ezekoka,项目名称:MonoGame-StarterKits,代码行数:13,代码来源:GameplayScreen.cs

示例3: HandleInput

        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) || gamePadDisconnected)
            {
                ScreenManager.AddScreen(new PauseMenuScreen(null), ControllingPlayer);
            }
        }
开发者ID:keaton-freude,项目名称:senior-project-arena,代码行数:23,代码来源:TestGameScreen.cs

示例4: HandleInput

        /// <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");

            // Mouse handle
            var curMouseState = Mouse.GetState();
            if (curMouseState.LeftButton == ButtonState.Pressed) {
                _mousePoint = _chessBoard.GetMatrixPosition(new Point(curMouseState.X, curMouseState.Y), 30);
            }

            // Look up inputs for the active player profile.
            if (ControllingPlayer != null) {
                var playerIndex = (int) ControllingPlayer.Value;

                var keyboardState = input.CurrentKeyboardStates[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!

                if (input.IsPauseGame(ControllingPlayer)) {
                    ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
                }
                else {
                    // Otherwise move the player position.
                    var movement = Vector2.Zero;

                    if (keyboardState.IsKeyDown(Keys.Left))
                        movement.X--;

                    if (keyboardState.IsKeyDown(Keys.Right))
                        movement.X++;

                    if (keyboardState.IsKeyDown(Keys.Up))
                        movement.Y--;

                    if (keyboardState.IsKeyDown(Keys.Down))
                        movement.Y++;

                    if (movement.Length() > 1)
                        movement.Normalize();

                    _playerPosition += movement*2;
                }
                // Mouse
            }
        }
开发者ID:nXqd,项目名称:XNAGame,代码行数:53,代码来源:GameplayScreen.cs

示例5: HandleInput

        public override void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            if (input.IsPauseGame(null))
            {
                if (!gameOver)
                    PauseCurrentGame();
                else
                    FinishCurrentGame();
            }

            if (IsActive && !startScreen)
            {
                if (input.Gestures.Count > 0)
                {
                    GestureSample sample = input.Gestures[0];
                    if (sample.GestureType == GestureType.Tap)
                    {
                        if (gameOver)
                            FinishCurrentGame();
                    }
                }

                if (!gameOver)
                {
                    // Rotate the maze according to accelerometer data
                    Vector3 currentAccelerometerState =
                            Accelerometer.GetState().Acceleration;

                    if (Microsoft.Devices.Environment.DeviceType == DeviceType.Device)
                    {
                        //Change the velocity according to acceleration reading
                        maze.Rotation.Z = (float)Math.Round(MathHelper.ToRadians(
                            currentAccelerometerState.Y * 30), 2);
                        maze.Rotation.X = -(float)Math.Round(MathHelper.ToRadians(
                            currentAccelerometerState.X * 30), 2);
                    }
                    else if (Microsoft.Devices.Environment.DeviceType ==
                        DeviceType.Emulator)
                    {
                        Vector3 Rotation = Vector3.Zero;

                        if (currentAccelerometerState.X != 0)
                        {
                            if (currentAccelerometerState.X > 0)
                                Rotation += new Vector3(0, 0, -angularVelocity);
                            else
                                Rotation += new Vector3(0, 0, angularVelocity);
                        }

                        if (currentAccelerometerState.Y != 0)
                        {
                            if (currentAccelerometerState.Y > 0)
                                Rotation += new Vector3(-angularVelocity, 0, 0);
                            else
                                Rotation += new Vector3(angularVelocity, 0, 0);
                        }

                        // Limit the rotation of the maze to 30 degrees
                        maze.Rotation.X =
                            MathHelper.Clamp(maze.Rotation.X + Rotation.X,
                            MathHelper.ToRadians(-30), MathHelper.ToRadians(30));

                        maze.Rotation.Z =
                            MathHelper.Clamp(maze.Rotation.Z + Rotation.Z,
                            MathHelper.ToRadians(-30), MathHelper.ToRadians(30));

                    }
                }
            }
        }
开发者ID:elixir67,项目名称:Sandbox,代码行数:73,代码来源:GameplayScreen.cs

示例6: HandleInput

        /// <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");

            if (input.IsPauseGame(ControllingPlayer))
            {
                ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
            }
            else
            {

            }
        }
开发者ID:theplaymate,项目名称:windespacman,代码行数:18,代码来源:GameplayScreen.cs

示例7: HandleInput

        /// <summary>
        /// Input helper method provided by GameScreen.  Packages up the various input
        /// values for ease of use.
        /// </summary>
        /// <param name="input">The state of the gamepads</param>
        public void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            if (gameOver)
            {
                if (input.IsPauseGame(null))
                {
                    FinishCurrentGame();
                }

                foreach (GestureSample gestureSample in input.Gestures)
                {
                    if (gestureSample.GestureType == GestureType.Tap)
                    {
                        FinishCurrentGame();
                    }
                }

                return;
            }

            if (input.IsPauseGame(null))
            {
                PauseCurrentGame();
            }
            else if (!isTwoHumanPlayers && isFirstPlayerTurn &&
                (playerOne.Catapult.CurrentState == CatapultState.Idle ||
                    playerOne.Catapult.CurrentState == CatapultState.Aiming))
            {
                // Read all available gestures
                foreach (GestureSample gestureSample in input.Gestures)
                {
                    if (gestureSample.GestureType == GestureType.FreeDrag)
                        isDragging = true;
                    else if (gestureSample.GestureType == GestureType.DragComplete)
                        isDragging = false;
                    playerOne.HandleInput(gestureSample);
                }
            }
            else if (!isPaused&&isTwoHumanPlayers && isFirstPlayerTurn && GlobalContext.PlayerIsFirstOnAppWarp &&(GlobalContext.joinedUsers.Length == 2)&&
               (playerOne.Catapult.CurrentState == CatapultState.Idle ||
                   playerOne.Catapult.CurrentState == CatapultState.Aiming))
            {
                // Read all available gestures
                foreach (GestureSample gestureSample in input.Gestures)
                {
                    if (gestureSample.GestureType == GestureType.FreeDrag)
                        isDragging = true;
                    else if (gestureSample.GestureType == GestureType.DragComplete)
                        isDragging = false;
                    playerOne.HandleInput(gestureSample);
                }
            }
            else if (!isPaused&&isTwoHumanPlayers && !isFirstPlayerTurn && !GlobalContext.PlayerIsFirstOnAppWarp && (GlobalContext.joinedUsers.Length == 2) &&
                (playerTwo.Catapult.CurrentState == CatapultState.Idle ||
                    playerTwo.Catapult.CurrentState == CatapultState.Aiming))
            {
                // Read all available gestures
                foreach (GestureSample gestureSample in input.Gestures)
                {
                    if (gestureSample.GestureType == GestureType.FreeDrag)
                        isDragging = true;
                    else if (gestureSample.GestureType == GestureType.DragComplete)
                        isDragging = false;
                    (playerTwo as Human).HandleInput(gestureSample);
                }
            }
        }
开发者ID:RajeevRShephertz,项目名称:CatapultWar,代码行数:75,代码来源:GamePage.xaml.cs

示例8: HandleInput

		/// <summary>
		/// Input helper method provided by GameScreen.  Packages up the various input
		/// values for ease of use.
		/// </summary>
		/// <param name="input">The state of the gamepads</param>
		public override void HandleInput (InputState input)
		{

			if (input == null)
				throw new ArgumentNullException ("input");

			if (gameOver) {
				if (input.IsPauseGame (null)) {
					FinishCurrentGame ();
				}

				if (input.MouseGesture.HasFlag(MouseGestureType.LeftClick))
					FinishCurrentGame();

				foreach (GestureSample gestureSample in input.Gestures) {
					if (gestureSample.GestureType == GestureType.Tap) {
						FinishCurrentGame ();
					}
				}

				return;
			}

			if (NetworkSession != null) {
				if ((isFirstPlayerTurn && !NetworkSession.IsHost)
				    || (!isFirstPlayerTurn && NetworkSession.IsHost))
					return;
			}

			if (input.IsPauseGame (null)) {
				PauseCurrentGame ();
			} else if (isFirstPlayerTurn &&
					(playerOne.Catapult.CurrentState == CatapultState.Idle ||
					playerOne.Catapult.CurrentState == CatapultState.Aiming)) {

				// First we try with mouse input
				playerOne.HandleInput (input);
				isDragging = playerOne.isDragging;

				// Read all available gestures
				foreach (GestureSample gestureSample in input.Gestures) {
					if (gestureSample.GestureType == GestureType.FreeDrag)
						isDragging = true;
					else if (gestureSample.GestureType == GestureType.DragComplete)
						isDragging = false;

					playerOne.HandleInput (gestureSample);
				}
			} else if (!isFirstPlayerTurn &&
					(playerTwo.Catapult.CurrentState == CatapultState.Idle ||
					playerTwo.Catapult.CurrentState == CatapultState.Aiming)) {

				// First we try with mouse input
				playerTwo.HandleInput (input);
				isDragging = playerTwo.isDragging;

				// Read all available gestures
				foreach (GestureSample gestureSample in input.Gestures) {
					if (gestureSample.GestureType == GestureType.FreeDrag)
						isDragging = true;
					else if (gestureSample.GestureType == GestureType.DragComplete)
						isDragging = false;

					playerTwo.HandleInput (gestureSample);
				}
			}
		}
开发者ID:kjpou1,项目名称:MonoGame-Samples,代码行数:72,代码来源:GameplayScreen.cs

示例9: HandleInput

        public override void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            if (input.IsPauseGame(null))
            {
                Exit();
            }

            // Return to main menu when tap on the phone
            if (input.Gestures.Count > 0)
            {
                GestureSample sample = input.Gestures[0];
                if (sample.GestureType == GestureType.Tap)
                {
                    Exit();

                    input.Gestures.Clear();
                }
            }
        }
开发者ID:elixir67,项目名称:Sandbox,代码行数:22,代码来源:HighScoreScreen.cs

示例10: HandleInput

 /// <summary>
 /// Responds to user input, changing the selected entry and accepting
 /// or cancelling the menu.
 /// Overriding to allow start,back,esc to unpause game
 /// </summary>
 public override void HandleInput(InputState input)
 {
     if (input.IsPauseGame(ControllingPlayer))
     {
         OnCancel(ControllingPlayer ?? PlayerIndex.One);
         return;
     }
     base.HandleInput(input);
 }
开发者ID:kmatzen,项目名称:EECS-494-Final-Project,代码行数:14,代码来源:PauseMenuScreen.cs

示例11: HandleInput

        /// <summary>
        /// Input helper method provided by GameScreen.  Packages up the various /// input values for ease of use.
        /// </summary>
        /// <param name="input">The state of the gamepads</param>
        public override void HandleInput(InputState input)
        {
            PlayerIndex player;

            if (input == null)
                throw new ArgumentNullException("input");

            if (input.IsNewKeyPress(Keys.F12, out player))
            {
                if (!Windows.UI.ViewManagement.ApplicationView
                        .GetForCurrentView().IsFullScreen)
                    Windows.UI.ViewManagement.ApplicationView
                        .GetForCurrentView().TryEnterFullScreenMode();
                else
                    Windows.UI.ViewManagement.ApplicationView
                        .GetForCurrentView().ExitFullScreenMode();
            }

            if (gameOver)
            {
                if (input.IsPauseGame())
                {
                    FinishCurrentGame();
                }

                if (input.IsNewKeyPress(Keys.Space, out player)
                    || input.IsNewKeyPress(Keys.Enter, out player))
                {
                    FinishCurrentGame();
                }

                if (input.IsNewGamePadButtonPress(Buttons.A, out player)
                    || input.IsNewGamePadButtonPress(Buttons.Start, out player))
                {
                    FinishCurrentGame();
                }

                if (input.IsNewMouseButtonPress(MouseButtons.LeftButton,
                                                out player))
                {
                    FinishCurrentGame();
                }

                foreach (GestureSample gestureSample in input.Gestures)
                {
                    if (gestureSample.GestureType == GestureType.Tap)
                    {
                        FinishCurrentGame();
                    }
                }

                return;
            }
        }
开发者ID:VoronFX,项目名称:SummerPractice,代码行数:58,代码来源:GameplayScreenBattle.cs

示例12: HandleInput

        /// <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;

            // get the keyboard state
            /** TODO - Kelner - Do gamepad shits **/
            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) || gamePadDisconnected)
            {
                ScreenManager.AddScreen(new PauseMenuScreen("pause"), ControllingPlayer);
            }

            // let the hero noodle on the input as well
            theHero.handleInput(keyboardState, _oldKeyState);

            // Kelner - store to know old state
            _oldKeyState = keyboardState;

            base.HandleInput(input);
        }
开发者ID:ckelner,项目名称:proto-lemming-death,代码行数:37,代码来源:GameplayScreen.cs

示例13: HandleInput

        /// <summary>
        /// Добавим реакцию игры на действия пользователя. В отличии от метода Апдейт,
        /// этот метод будет вызван, когда экран Геймплей будет активным.
        /// </summary>
        public override void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            ///Проверка действий для действий пользователя
            int 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);
            }
            else
            {
                // Иначе передвигаем позицию игрока
                Vector2 movement = Vector2.Zero;

                if (keyboardState.IsKeyDown(Keys.Left))
                    movement.X--;

                if (keyboardState.IsKeyDown(Keys.Right))
                    movement.X++;

                if (keyboardState.IsKeyDown(Keys.Up))
                    movement.Y--;

                if (keyboardState.IsKeyDown(Keys.Down))
                    movement.Y++;

                Vector2 thumbstick = gamePadState.ThumbSticks.Left;

                movement.X += thumbstick.X;
                movement.Y -= thumbstick.Y;

                if (movement.Length() > 1)
                    movement.Normalize();

                playerPosition += movement * 2;
            }
        }
开发者ID:Nastya11,项目名称:Games,代码行数:55,代码来源:GamePlayScreen.cs

示例14: HandleInput

        /// <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;

            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 (gameObjectManager.isLevelCompleted())
            {
                ScreenManager.AddScreen(new LevelCompleteScreen(), ControllingPlayer);
            }
            else if(gameObjectManager.isGameOver())
            {
                ScreenManager.AddScreen(new GameOverScreen(), ControllingPlayer);
            }
            else if (input.IsPauseGame(ControllingPlayer) || gamePadDisconnected)
            {
                ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer);
            }
            else
            {
                // Otherwise move the player position.
                Vector2 movement = Vector2.Zero;

                if (keyboardState.IsKeyDown(Keys.Left))
                {
                    movement.X--;
                    lastMove = 1;
                }

                if (keyboardState.IsKeyDown(Keys.Right))
                {
                    movement.X++;
                    lastMove = 3;
                }

                if (keyboardState.IsKeyDown(Keys.Up))
                {
                    movement.Y--;
                    lastMove = 0;
                }

                if (keyboardState.IsKeyDown(Keys.Down))
                {
                    movement.Y++;
                    lastMove = 2;
                }

                #region codes

                if (keyboardState.IsKeyDown(Keys.D0))
                {
                    if (code.Count == 4)
                        code.RemoveAt(0);
                    if(code[code.Count-1] != 0)
                        code.Add(0);
                }

                if (keyboardState.IsKeyDown(Keys.D1))
                {
                    if (code.Count == 4)
                        code.RemoveAt(0);
                    if (code[code.Count - 1] != 1)
                        code.Add(1);
                }

                if (keyboardState.IsKeyDown(Keys.D2))
                {
                    if (code.Count == 4)
                        code.RemoveAt(0);
                    if (code[code.Count - 1] != 2)
                        code.Add(2);
                }

                if (keyboardState.IsKeyDown(Keys.D3))
                {
                    if (code.Count == 4)
                        code.RemoveAt(0);
                    if (code[code.Count - 1] != 3)
                        code.Add(3);
                }

                if (keyboardState.IsKeyDown(Keys.D4))
                {
                    if (code.Count == 4)
//.........这里部分代码省略.........
开发者ID:lioralterman,项目名称:xnapacman,代码行数:101,代码来源:GameplayScreen.cs

示例15: HandleInput

        // END DEBUG
        /// <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.
            //for(int playerIndex = 0; playerIndex < Math.Min(players.Count, InputState.MaxInputs);  ++playerIndex) {
            foreach(Player cP in players) {

                KeyboardState keyboardState = input.CurrentKeyboardStates[(int)cP.PI];
                GamePadState gamePadState = input.CurrentGamePadStates[(int)cP.PI];

                // 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[(int)cP.PI];

                if (input.IsPauseGame(cP.PI) || gamePadDisconnected)
                {
                    ScreenManager.AddScreen(new PauseMenuScreen(), cP.PI);
                }
                else if (curGameState == GameState.Placement)
                {
                    HandlePlacementInputButtons(input, cP);
                }
                else if (curGameState == GameState.Playing)
                {
                    HandleGameplayInputButtons(input, cP);
                }

                // Otherwise move the player position.
                if (true)
                {
                    Vector2 movement = Vector2.Zero;
                    if (true)//cP.PI == PlayerIndex.One)
                    {
                        if (keyboardState.IsKeyDown(Keys.Left))
                        {
                            movement.X--;
                        }

                        if (keyboardState.IsKeyDown(Keys.Right))
                        {
                            movement.X++;
                        }

                        if (keyboardState.IsKeyDown(Keys.Up))
                        {
                            movement.Y--;
                        }

                        if (keyboardState.IsKeyDown(Keys.Down))
                        {
                            movement.Y++;
                        }
                    }

                    Vector2 thumbstick = gamePadState.ThumbSticks.Left;

                    movement.X += thumbstick.X;
                    movement.Y -= thumbstick.Y;

                    if (movement.Length() > 1)
                        movement.Normalize();

                    cP.pos += movement * 10;
                    //if (cP.pos.X < offset.X)
                    //    cP.pos.X = offset.X;
                    //if (cP.pos.Y < offset.Y)
                    //    cP.pos.Y = offset.Y;
                    //if (cP.pos.X > COLS * country.Width + offset.X - 1)
                    //    cP.pos.X = COLS * country.Width + offset.X - 1;
                    //if (cP.pos.Y > ROWS * country.Height + offset.Y - 1)
                    //    cP.pos.Y = ROWS * country.Height + offset.Y - 1;
                    if (cP.pos.X < 0)
                    {
                        if (OptionsMenuScreen.currentMap == OptionsMenuScreen.Map.World)
                            cP.pos.X = screenWidth;
                        else
                            cP.pos.X = 0;
                    }
                    if (cP.pos.Y < 0)
                        cP.pos.Y = 0;
                    if (cP.pos.X > screenWidth)
                    {
                        if (OptionsMenuScreen.currentMap == OptionsMenuScreen.Map.World)
                            cP.pos.X = 0;
                        else
                            cP.pos.X = screenWidth;
                    }
                    if (cP.pos.Y > screenHeight)
                        cP.pos.Y = screenHeight;

                    cP.hover = closestCountry(cP.pos);
//.........这里部分代码省略.........
开发者ID:kzielnicki,项目名称:Brisk,代码行数:101,代码来源:GameplayScreen.cs


注:本文中的GameStateManagement.InputState.IsPauseGame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。