示例#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);
 }
示例#2
0
 public PowerupAcquiredEventArgs(Vehicle vehicle, Powerup powerup)
 {
     this.Vehicle = vehicle;
     this.Powerup = powerup;
 }
示例#3
0
文件: Player.cs 项目: kindohm/tanks
 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);
     }
 }
示例#4
0
文件: Player.cs 项目: kindohm/tanks
 public static void ApplyPowerup(Player player, List<Vehicle> vehicles, Powerup powerup)
 {
     foreach (Vehicle vehicle in vehicles)
     {
         Player.ApplyPowerup(player, vehicle, powerup);
     }
 }
示例#5
0
文件: Round.cs 项目: kindohm/tanks
 void FloatPowerup(Powerup powerup)
 {
     powerup.Body.ApplyForce(new Vector2(0, -2570));
 }
示例#6
0
文件: Round.cs 项目: kindohm/tanks
 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));
     }
 }