Example #1
0
 // Listen for a pause and do so at this time
 public void ListenPause()
 {
     // Pausing while in a board state:
     if (km.ActionPressed(KeyboardManager.action.pause, KeyboardManager.playerIndex.one))
     {
         S_Pause pauseMenu = new S_Pause(parentManager, 0, 0, KeyboardManager.playerIndex.one);
         parentManager.AddStateQueue(pauseMenu);
         Console.WriteLine("Player 1 paused the game");
     }
     else if (km.ActionPressed(KeyboardManager.action.pause, KeyboardManager.playerIndex.two))
     {
         S_Pause pauseMenu = new S_Pause(parentManager, 0, 0, KeyboardManager.playerIndex.two);
         parentManager.AddStateQueue(pauseMenu);
         Console.WriteLine("Player 2 paused the game");
     }
 }
Example #2
0
        public S_CameraMode(GameStateManager creator, float xPos, float yPos, S_Pause s_Pause) : base(creator, xPos, yPos)
        {
            cameraProperties = parentManager.boardGame.cameraProperties;
            // Pause the pause menu (lol)
            this.s_Pause    = s_Pause;
            s_Pause.active  = false;
            s_Pause.visible = false;

            // Hide other states so we see just the gameboard
            foreach (State s in parentManager.states)
            {
                if (!s.GetType().Equals(typeof(B_PirateBay)) && s != this)
                {
                    s.visible = false;
                }
            }

            // Save where the camera was
            oldCameraPos = cameraProperties.getPos();
        }