コード例 #1
0
 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;
     }
 }
コード例 #2
0
 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;
            }
        }