Beispiel #1
0
 private void selectWeapon()
 {
     if (KeyboardDevice.isKeyTapped(Microsoft.Xna.Framework.Input.Keys.D1))
     {
         weapon = weaponRack[0];
     }
     else if (KeyboardDevice.isKeyTapped(Microsoft.Xna.Framework.Input.Keys.D2))
     {
         weapon = weaponRack[1];
     }
     else if (KeyboardDevice.isKeyTapped(Microsoft.Xna.Framework.Input.Keys.D3))
     {
         weapon = weaponRack[2];
     }
     else if (KeyboardDevice.isKeyTapped(Microsoft.Xna.Framework.Input.Keys.D4))
     {
         weapon = weaponRack[3];
     }
     if (KeyboardDevice.isKeyTapped(Microsoft.Xna.Framework.Input.Keys.D5))
     {
         weapon = weaponRack[4];
     }
 }
Beispiel #2
0
        private void checkControl()
        {
            // pause game speed
            if (KeyboardDevice.isKeyTapped(Keys.W))
            {
                stop = !stop;
                if (stop)
                {
                    Console.WriteLine("Entering debug mode - press 'W' to resume game");
                    Speed = 0f;
                }
                else
                {
                    Console.WriteLine("Exiting debug mode");
                    Speed = SpeedReference;
                }
            }

            if (KeyboardDevice.isKeyTapped(Keys.P))
            {
                eManager.killAll();
            }
        }