Exemple #1
0
 protected override void PlaceVehicles(Vehicle userVehicle, System.Collections.Generic.List<Vehicle> enemyVehicles)
 {
     userVehicle.Position = new Vector2(600, 600);
     enemyVehicles[0].Position = new Vector2(830, 250);
     enemyVehicles[1].Position = new Vector2(150, 600);
     enemyVehicles[2].Position = new Vector2(375, 600);
 }
Exemple #2
0
 protected override void PlaceVehicles(Vehicle userVehicle, System.Collections.Generic.List<Vehicle> enemyVehicles)
 {
     userVehicle.Position = new Vector2(550, 550);
     enemyVehicles[0].Position = new Vector2(850, 550);
     enemyVehicles[1].Position = new Vector2(300, 500);
     enemyVehicles[2].Position = new Vector2(100, 450);
 }
Exemple #3
0
 public static void ApplyLlamaGunPowerup(Player player, Vehicle vehicle, LlamaGunPowerup powerup)
 {
     foreach (Weapon weapon in vehicle.Weapons)
     {
         if (weapon is LlamaGun)
         {
             return;
         }
     }
     player.HasLlama = true;
     vehicle.Weapons.Add(new LlamaGun(player.simulator));
 }
Exemple #4
0
 public VehicleBrush(Vehicle vehicle)
 {
     InitializeComponent();
     this.vehicle = vehicle;
     this.Extender.RotateTransform = rotateTransform;
     this.Extender.Child = this.vehicleCanvas;
     vehicle.Died += new EventHandler<VehicleEventArgs>(vehicle_Died);
     vehicle.FiredShot += new EventHandler<FiredShotEventArgs>(vehicle_FiredShot);
     this.explode.Completed += new EventHandler(explode_Completed);
     if (vehicle.ControlledByUser)
     {
         Page.SceneLoop.Update += new EventHandler<SceneLoopEventArgs>(sceneLoop_Update);
     }
     vehicle.ControlledByUserChanged += new EventHandler<VehicleEventArgs>(vehicle_ControlledByUserChanged);
 }
Exemple #5
0
 public static void ApplyDamageBonusPowerup(Vehicle vehicle, DamagePowerup powerup)
 {
     vehicle.DamageBonus = vehicle.DamageBonus + powerup.Value;
 }
Exemple #6
0
 public static void ApplyBurstPowerup(Vehicle vehicle, BurstPowerup powerup)
 {
     vehicle.Bursting = true;
 }
Exemple #7
0
 public static void ApplyAccuracyPowerup(Vehicle vehicle, AccuracyPowerup powerup)
 {
     vehicle.PercentError = vehicle.PercentError - (vehicle.PercentError * powerup.Value);
 }
Exemple #8
0
 public void ApplyAllPowerups(Vehicle vehicle)
 {
     foreach (Powerup powerup in this.Powerups)
     {
         Player.ApplyPowerup(this, vehicle, powerup);
     }
 }
Exemple #9
0
        protected override void PlaceVehicles(Vehicle userVehicle, System.Collections.Generic.List<Vehicle> enemyVehicles)
        {
            if (this.map is MapADefinition)
            {
                userVehicle.Position = new Vector2(500, 650);
                enemyVehicles[0].Position = new Vector2(100, 650);
                enemyVehicles[1].Position = new Vector2(300, 650);
                enemyVehicles[2].Position = new Vector2(700, 650);
                enemyVehicles[3].Position = new Vector2(900, 650);
            }
            else if (this.map is MapBDefinition)
            {
                userVehicle.Position = new Vector2(500, 600);
                enemyVehicles[0].Position = new Vector2(100, 600);
                enemyVehicles[1].Position = new Vector2(300, 550);
                enemyVehicles[2].Position = new Vector2(700, 550);
                enemyVehicles[3].Position = new Vector2(900, 650);
            }
            else if (this.map is MapCDefinition)
            {
                userVehicle.Position = new Vector2(700, 420);
                enemyVehicles[0].Position = new Vector2(100, 440);
                enemyVehicles[1].Position = new Vector2(250, 440);
                enemyVehicles[2].Position = new Vector2(800, 410);
                enemyVehicles[3].Position = new Vector2(900, 400);
            }
            else if (this.map is MapDDefinition)
            {
                userVehicle.Position = new Vector2(350, 500);
                enemyVehicles[0].Position = new Vector2(100, 450);
                enemyVehicles[1].Position = new Vector2(210, 460);
                enemyVehicles[2].Position = new Vector2(800, 470);
                enemyVehicles[3].Position = new Vector2(900, 470);
            }

            else if (this.map is MapEDefinition)
            {
                userVehicle.Position = new Vector2(500, 600);
                enemyVehicles[0].Position = new Vector2(100, 460);
                enemyVehicles[1].Position = new Vector2(300, 500);
                enemyVehicles[2].Position = new Vector2(700, 600);
                enemyVehicles[3].Position = new Vector2(900, 580);
            }
            else if (this.map is MapFDefinition)
            {
                userVehicle.Position = new Vector2(600, 600);
                enemyVehicles[0].Position = new Vector2(830, 250);
                enemyVehicles[1].Position = new Vector2(100, 600);
                enemyVehicles[2].Position = new Vector2(325, 600);
                enemyVehicles[3].Position = new Vector2(450, 590);
            }
            else if (this.map is MapGDefinition)
            {
                userVehicle.Position = new Vector2(500, 600);
                enemyVehicles[0].Position = new Vector2(200, 150);
                enemyVehicles[1].Position = new Vector2(250, 600);
                enemyVehicles[2].Position = new Vector2(700, 600);
                enemyVehicles[3].Position = new Vector2(900, 590);
            }
            else if (this.map is MapHDefinition)
            {
                userVehicle.Position = new Vector2(500, 600);
                enemyVehicles[0].Position = new Vector2(100, 350);
                enemyVehicles[1].Position = new Vector2(900, 350);
                enemyVehicles[2].Position = new Vector2(100, 600);
                enemyVehicles[3].Position = new Vector2(900, 600);
            }
        }
 public HitPointsChangedEventArgs(Vehicle vehicle, int change)
 {
     this.Change = change;
     this.Vehicle = vehicle;
 }
Exemple #11
0
 void HitVehicle(Vehicle vehicle)
 {
     vehicle.HitPoints = vehicle.HitPoints - this.TotalDamage;
     vehicle.TakeHit(this);
 }
Exemple #12
0
 public FiredShotEventArgs(Vehicle vehicle, Vector2 trajectory)
 {
     this.Vehicle = vehicle;
     this.Trajectory = trajectory;
 }
Exemple #13
0
 public HitTargetEventArgs(Vehicle source, Vehicle target)
 {
     this.Source = source;
     this.Target = target;
 }
Exemple #14
0
 public TankBrush(Vehicle vehicle)
 {
     this.vehicle = vehicle;
     InitializeComponent();
     this.Loaded += new RoutedEventHandler(TankBrush_Loaded);
 }
Exemple #15
0
 void Construct()
 {
     this.powerupInterval = 280;
     Page.SceneLoop.Update += new EventHandler<SceneLoopEventArgs>(sceneLoop_Update);
     this.enemyCount = 1;
     this.enemyRateOfFireBonus = 0;
     this.enemyPercentError = .15f;
     this.enemySingleShot = true;
     this.vehicleList = new List<Vehicle>();
     this.projectileList = new List<Projectile>();
     this.powerups = new List<Powerup>();
     this.wind = new Wind();
     this.userTank = new Vehicle(simulator, this);
     this.userTank.HitPoints = 200;
     this.userTank.FiredShot += new EventHandler<FiredShotEventArgs>(userTank_FiredShot);
     this.userTank.HitTarget += new EventHandler<HitTargetEventArgs>(userTank_HitTarget);
     this.userTank.HitProjectile += new EventHandler<VehicleEventArgs>(userTank_HitProjectile);
     this.userTank.HitPowerup += new EventHandler<VehicleEventArgs>(userTank_HitPowerup);
     this.userTank.ProjectileCreated += new EventHandler<ProjectileEventArgs>(userTank_ProjectileCreated);
     this.userTank.TookHit += new EventHandler<VehicleEventArgs>(userTank_TookHit);
     this.userTank.RateOfFireBonus = .5;
     this.userTank.AllowedToFire = true;
     this.userTank.PercentError = .15d;
     this.userTank.ControlledByUser = true;
     this.userTank.Color = Colors.Orange;
     this.map = this.CreateMap(simulator);
     this.ceiling = new Ceiling(simulator);
     this.rightWall = this.CreateRightWall(simulator);
     this.leftWall = this.CreateLeftWall(simulator);
     this.vehicleList.Add(this.userTank);
     this.Initialize(simulator);
 }
Exemple #16
0
 protected virtual void PlaceVehicles(Vehicle userVehicle, List<Vehicle> enemyVehicles)
 {
     userVehicle.Position = new Vector2(100, 600);
     foreach (Vehicle vehicle in enemyVehicles)
     {
         int x = Randomizer.Random.Next(300, 800);
         vehicle.Position = new Vector2(x, 600);
     }
 }
Exemple #17
0
 public static void ApplyMaxHealthPowerup(Vehicle vehicle, MaxHealthPowerup powerup)
 {
     vehicle.MaxHitPoints = vehicle.MaxHitPoints + (int)((double)vehicle.MaxHitPoints * powerup.Value);
 }
Exemple #18
0
 public WeaponDisplay(Vehicle vehicle)
 {
     this.vehicle = vehicle;
     InitializeComponent();
     this.Loaded += new System.Windows.RoutedEventHandler(WeaponDisplay_Loaded);
 }
Exemple #19
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);
     }
 }
Exemple #20
0
 protected override void PlaceVehicles(Vehicle userVehicle, System.Collections.Generic.List<Vehicle> enemyVehicles)
 {
     userVehicle.Position = new Vector2(200, 300);
     enemyVehicles[0].Position = new Vector2(800, 300);
 }
Exemple #21
0
 public VehicleEventArgs(Vehicle vehicle)
 {
     this.Vehicle = vehicle;
 }
Exemple #22
0
 public static void ApplyRateOfFirePowerup(Vehicle vehicle, RateOfFirePowerup powerup)
 {
     vehicle.RateOfFireBonus = vehicle.RateOfFireBonus + powerup.Value;
 }
 public PowerupAcquiredEventArgs(Vehicle vehicle, Powerup powerup)
 {
     this.Vehicle = vehicle;
     this.Powerup = powerup;
 }
Exemple #24
0
 public static void ApplyUziPowerup(Player player, Vehicle vehicle, UziPowerup powerup)
 {
     foreach (Weapon weapon in vehicle.Weapons)
     {
         if (weapon is Uzi)
         {
             return;
         }
     }
     player.HasUzi = true;
     vehicle.Weapons.Add(new Uzi(player.simulator));
 }