public void CheckSinglePressKeys(KeyboardState keyboardState)
 {
     // Exit in-game menu
     if (keyboardState.IsKeyDown(Keys.Escape))
     {
         if (!holdingExitMenu)
         {
             LimitsEdgeGame.SwitchState(GameState.InGameMenu, GameState.World);
         }
         holdingExitMenu = true;
     }
     else
     {
         holdingExitMenu = false;
     }
 }
 public void CheckSinglePressKeys(KeyboardState keyboardState)
 {
     // Exit ship
     if (keyboardState.IsKeyDown(Keys.E))
     {
         if (!holdingExitInventory)
         {
             LimitsEdgeGame.SwitchState(GameState.Inventory, GameState.World);
             LimitsEdgeGame.currentCamera = LimitsEdgeGame.worldCamera;
         }
         holdingExitInventory = true;
     }
     else
     {
         holdingExitInventory = false;
     }
 }
示例#3
0
        public void CheckSinglePressKeys(KeyboardState keyboardState)
        {
            PlayerShip playerShip = LimitsEdgeGame.worldStateManager.playerManager.playerShip;

            // In-game menu
            if (keyboardState.IsKeyDown(Keys.Escape))
            {
                if (!holdingInGameMenu)
                {
                    LimitsEdgeGame.SwitchState(GameState.World, GameState.InGameMenu);
                }
                holdingInGameMenu = true;
            }
            else
            {
                holdingInGameMenu = false;
            }

            // Ship inventory
            if (keyboardState.IsKeyDown(Keys.E))
            {
                if (!holdingShipInv)
                {
                    LimitsEdgeGame.SwitchState(GameState.World, GameState.Inventory);
                }
                holdingShipInv = true;
            }
            else
            {
                holdingShipInv = false;
            }

            // Debugging toggle
            if (keyboardState.IsKeyDown(Keys.Tab))
            {
                if (!holdingToggleDebug)
                {
                    LimitsEdgeGame.worldStateManager.debugManager.ToggleDebugLevels();
                }
                holdingToggleDebug = true;
            }
            else
            {
                holdingToggleDebug = false;
            }

            if (keyboardState.IsKeyDown(Keys.Q))
            {
                if (!holdingSwitchLockOn)
                {
                    TryLockOn(playerShip);
                }
                holdingSwitchLockOn = true;
            }
            else
            {
                holdingSwitchLockOn = false;
            }

            if (keyboardState.IsKeyDown(Keys.R))
            {
                if (!holdingLockOn && playerShip.lockOnSprite != null)
                {
                    playerShip.lockOnDistance = (playerShip.lockOnSprite.position - playerShip.position).Length();
                }
                holdingLockOn = true;
            }
            else
            {
                holdingLockOn = false;
            }
        }