Ejemplo n.º 1
0
 public PowerUp getActivePowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
     {
         if (p.Type == type)
         {
             return(p);
         }
     }
     return(null);
 }
Ejemplo n.º 2
0
 public static bool IsPowerUpAlive(PowerUpType type)
 {
     foreach (PowerUp p in AlivePowerUps)
     {
         if (p.Type == type)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
 public bool hasPowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
     {
         if (p.Type == type)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 4
0
 public void removePowerUp(PowerUpType type)
 {
     for (int i = 0; i < ActivePowerUps.Count;)
     {
         PowerUp p = ActivePowerUps[i];
         if (p.Type == type)
         {
             ActivePowerUps.Remove(p);
         }
         else
         {
             i++;
         }
     }
 }
Ejemplo n.º 5
0
 private PowerUp(Rectangle rectangle, PowerUpType type)
     : base(rectangle, new Vector2(0, 0))
 {
     this.type = type;
     this.Texture = type.Texture;
     aliveDuration = type.AliveDuration;
     if (type == PowerUpType.SledgeHammer)
         activeDuration = GameSettings.DEFAULTSLEDGEHAMMERACTIVEDURATION;
     else if (type == PowerUpType.CanShield)
         activeDuration = GameSettings.DEFAULTCANSHIELDACTIVEDURATION;
     else
         activeDuration = type.ActiveDuration;
     Charges = type.Charges;
     aliveTimer = new Stopwatch();
     activeTimer = new Stopwatch();
     aliveTimer.Start();
 }
Ejemplo n.º 6
0
 private PowerUp(Rectangle rectangle, PowerUpType type)
     : base(rectangle, new Vector2(0, 0))
 {
     this.type     = type;
     this.Texture  = type.Texture;
     aliveDuration = type.AliveDuration;
     if (type == PowerUpType.SledgeHammer)
     {
         activeDuration = GameSettings.DEFAULTSLEDGEHAMMERACTIVEDURATION;
     }
     else if (type == PowerUpType.CanShield)
     {
         activeDuration = GameSettings.DEFAULTCANSHIELDACTIVEDURATION;
     }
     else
     {
         activeDuration = type.ActiveDuration;
     }
     Charges     = type.Charges;
     aliveTimer  = new Stopwatch();
     activeTimer = new Stopwatch();
     aliveTimer.Start();
 }
Ejemplo n.º 7
0
 public static bool IsPowerUpAlive(PowerUpType type)
 {
     foreach (PowerUp p in AlivePowerUps)
         if (p.Type == type)
             return true;
     return false;
 }
Ejemplo n.º 8
0
 public void removePowerUp(PowerUpType type)
 {
     for (int i = 0; i < ActivePowerUps.Count; )
     {
         PowerUp p = ActivePowerUps[i];
         if (p.Type == type)
             ActivePowerUps.Remove(p);
         else
             i++;
     }
 }
Ejemplo n.º 9
0
 public bool hasPowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
         if (p.Type == type)
             return true;
     return false;
 }
Ejemplo n.º 10
0
 public PowerUp getActivePowerUp(PowerUpType type)
 {
     foreach (PowerUp p in ActivePowerUps)
         if (p.Type == type)
             return p;
     return null;
 }