Beispiel #1
0
 public PowerupBrush(Powerup powerup, Color color)
 {
     this.color = color;
     this.powerup = powerup;
     this.powerup.PowerupExpired += new System.EventHandler(powerup_PowerupExpired);
     this.InitializeComponent();
     this.Loaded += new RoutedEventHandler(PowerupBrush_Loaded);
 }
 public PowerupAcquiredEventArgs(Vehicle vehicle, Powerup powerup)
 {
     this.Vehicle = vehicle;
     this.Powerup = powerup;
 }
Beispiel #3
0
 public static void ApplyPowerup(Player player, Vehicle vehicle, Powerup powerup)
 {
     if (powerup is RateOfFirePowerup)
     {
         Player.ApplyRateOfFirePowerup(vehicle, powerup as RateOfFirePowerup);
     }
     else if (powerup is MaxHealthPowerup)
     {
         Player.ApplyMaxHealthPowerup(vehicle, powerup as MaxHealthPowerup);
     }
     else if (powerup is HealthPowerup)
     {
         Player.ApplyHealthPowerup(vehicle, powerup as HealthPowerup);
     }
     else if (powerup is UziPowerup && player != null)
     {
         Player.ApplyUziPowerup(player, vehicle, powerup as UziPowerup);
     }
     else if (powerup is LlamaGunPowerup && player != null)
     {
         Player.ApplyLlamaGunPowerup(player, vehicle, powerup as LlamaGunPowerup);
     }
     else if (powerup is DamagePowerup)
     {
         Player.ApplyDamageBonusPowerup(vehicle, powerup as DamagePowerup);
     }
     else if (powerup is AccuracyPowerup)
     {
         Player.ApplyAccuracyPowerup(vehicle, powerup as AccuracyPowerup);
     }
     else if (powerup is BurstPowerup)
     {
         Player.ApplyBurstPowerup(vehicle, powerup as BurstPowerup);
     }
 }
Beispiel #4
0
 public static void ApplyPowerup(Player player, List<Vehicle> vehicles, Powerup powerup)
 {
     foreach (Vehicle vehicle in vehicles)
     {
         Player.ApplyPowerup(player, vehicle, powerup);
     }
 }
Beispiel #5
0
 void FloatPowerup(Powerup powerup)
 {
     powerup.Body.ApplyForce(new Vector2(0, -2570));
 }
Beispiel #6
0
 protected void RegisterPowerup(Powerup powerup)
 {
     this.powerups.Add(powerup);
     powerup.PowerupAcquired += new EventHandler<PowerupAcquiredEventArgs>(powerup_PowerupAcquired);
     if (this.PowerupCreated != null)
     {
         this.PowerupCreated(this, new PowerupEventArgs(powerup));
     }
 }