Beispiel #1
0
 public void UpdateDebugKeys()
 {
     //update debug keys
     if (pressedThisFrame(Keys.Y) && this == RetroGame.getHeroes()[0])
     {
         if (GetPowerup("Rocket") is RocketBurst)
         {
             RemovePowerup("Rocket");
             AddPowerup(typeof(RocketBoost));
         }
         else
         {
             if (HasPowerup("Rocket"))
             {
                 RemovePowerup("Rocket");
             }
             AddPowerup(typeof(RocketBurst));
         }
     }
     if (pressedThisFrame(Keys.U))
     {
         if (GetPowerup("Gun") is ShotForward)
         {
             RemovePowerup("Gun");
             AddPowerup(typeof(ShotSide));
         }
         else if (GetPowerup("Gun") is ShotSide)
         {
             RemovePowerup("Gun");
             AddPowerup(typeof(ShotCharge));
         }
         else if (GetPowerup("Gun") is ShotCharge)
         {
             RemovePowerup("Gun");
             AddPowerup(typeof(Flamethrower));
         }
         else if (GetPowerup("Flamethrower") is Flamethrower)
         {
             RemovePowerup("Flamethrower");
         }
         else
         {
             if (HasPowerup("Gun"))
             {
                 RemovePowerup("Gun");
             }
             AddPowerup(typeof(ShotForward));
         }
     }
     else if (pressedThisFrame(Keys.I))
     {
         if (GetPowerup("Retro") is RetroPort)
         {
             RemovePowerup("Retro");
             AddPowerup(typeof(RetroStasis));
         }
         else
         {
             if (HasPowerup("Retro"))
             {
                 RemovePowerup("Retro");
             }
             AddPowerup(typeof(RetroPort));
         }
     }
     else if (pressedThisFrame(Keys.O))
     {
         if (GetPowerup("Drill") is DrillFast && !(GetPowerup("Drill") is DrillBasic))
         {
             RemovePowerup("Drill");
             AddPowerup(typeof(DrillTriple));
         }
         else if (GetPowerup("Drill") is DrillTriple)
         {
             RemovePowerup("Drill");
             AddPowerup(typeof(DrillBasic));
         }
         else
         {
             if (HasPowerup("Drill"))
             {
                 RemovePowerup("Drill");
             }
             AddPowerup(typeof(DrillFast));
         }
     }
     else if (pressedThisFrame(Keys.P))
     {
         if (GetPowerup("Radar") is RadarPowerup)
         {
             RemovePowerup("Radar");
         }
         else
         {
             AddPowerup(typeof(RadarPowerup));
         }
     }
     else if (pressedThisFrame(Keys.B))
     {
         if (GetPowerup("Bomb") is BombTimed)
         {
             RemovePowerup("Bomb");
             AddPowerup(typeof(BombSet));
         }
         else
         {
             if (HasPowerup("Bomb"))
             {
                 RemovePowerup("Bomb");
             }
             AddPowerup(typeof(BombTimed));
         }
     }
     else if (pressedThisFrame(Keys.V))
     {
         if (playerIndex == 0)
         {
             if (GetPowerup("Chains") is FireChains)
             {
                 RemovePowerup("Chains");
             }
             else
             {
                 AddPowerup(typeof(FireChains));
             }
         }
     }
     else if (pressedThisFrame(Keys.OemOpenBrackets))
     {
         RetroGame.AddSand();
         RetroGame.AddScore(10000);
         RetroGame.AddBomb();
         for (int i = 0; i < 10; i++)
         {
             RetroGame.AddGem();
         }
     }
     else if (pressedThisFrame(Keys.OemCloseBrackets))
     {
         health -= INITIAL_HEALTH * 0.1f;
     }
     else if (pressedThisFrame(Keys.H)) /*MUSICTEST*/
     {
         SoundManager.PlaySoundAsMusic("LowRumble");
     }
     else if (pressedThisFrame(Keys.N))
     {
         SoundManager.StopMusic();
     }
     else if (pressedThisFrame(Keys.J))
     {
         SoundManager.SetMusicReverse(true);
     }
     else if (pressedThisFrame(Keys.M))
     {
         SoundManager.SetMusicReverse(false);
     }
     else if (pressedThisFrame(Keys.K))
     {
         SoundManager.SetMusicPitch(-1f);
     }
     else if (pressedThisFrame(Keys.OemComma))
     {
         SoundManager.SetMusicPitch(1f);
     }
     else if (pressedThisFrame(Keys.OemPeriod))
     {
         SoundManager.SetMusicPitch(0f);
     }
 }