Пример #1
0
 //uses neutralize powerup if conditions are right
 public void UseNeutralize()
 {
     foreach (Well well in ParentGame.StableWells.ToList())
     {
         if (Math.Pow(Xcoor - well.Xcoor, 2) + Math.Pow(Ycoor - well.Ycoor, 2) < 30000)
         {
             GamePowerup.Neutralize();
         }
     }
 }
Пример #2
0
        //This method deals with a keypress. It either updates the user directional input, does a speed boost, or uses a powerup.
        public void KeyPressed(char c)
        {
            switch (c)
            {
            case 'w':
                VerticalInput = -1;
                break;

            case 'a':
                HorizontalInput = -1;
                break;

            case 's':
                VerticalInput = 1;
                break;

            case 'd':
                HorizontalInput = 1;
                break;

            case ' ':
                SpeedBoost();
                break;

            case 'q':
                GamePowerup.Neutralize();
                break;

            case 'f':
                GamePowerup.Destabilize();
                break;

            case 'e':
                GamePowerup.Ghost();
                break;
            }
        }