예제 #1
0
파일: Round6.cs 프로젝트: kindohm/tanks
 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);
 }
예제 #2
0
파일: Round5.cs 프로젝트: kindohm/tanks
 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);
 }
예제 #3
0
파일: Player.cs 프로젝트: kindohm/tanks
 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));
 }
예제 #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);
 }
예제 #5
0
파일: Player.cs 프로젝트: kindohm/tanks
 public static void ApplyDamageBonusPowerup(Vehicle vehicle, DamagePowerup powerup)
 {
     vehicle.DamageBonus = vehicle.DamageBonus + powerup.Value;
 }
예제 #6
0
파일: Player.cs 프로젝트: kindohm/tanks
 public static void ApplyBurstPowerup(Vehicle vehicle, BurstPowerup powerup)
 {
     vehicle.Bursting = true;
 }
예제 #7
0
파일: Player.cs 프로젝트: kindohm/tanks
 public static void ApplyAccuracyPowerup(Vehicle vehicle, AccuracyPowerup powerup)
 {
     vehicle.PercentError = vehicle.PercentError - (vehicle.PercentError * powerup.Value);
 }
예제 #8
0
파일: Player.cs 프로젝트: kindohm/tanks
 public void ApplyAllPowerups(Vehicle vehicle)
 {
     foreach (Powerup powerup in this.Powerups)
     {
         Player.ApplyPowerup(this, vehicle, powerup);
     }
 }
예제 #9
0
파일: Round9.cs 프로젝트: kindohm/tanks
        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);
            }
        }
예제 #10
0
 public HitPointsChangedEventArgs(Vehicle vehicle, int change)
 {
     this.Change = change;
     this.Vehicle = vehicle;
 }
예제 #11
0
파일: Projectile.cs 프로젝트: kindohm/tanks
 void HitVehicle(Vehicle vehicle)
 {
     vehicle.HitPoints = vehicle.HitPoints - this.TotalDamage;
     vehicle.TakeHit(this);
 }
예제 #12
0
 public FiredShotEventArgs(Vehicle vehicle, Vector2 trajectory)
 {
     this.Vehicle = vehicle;
     this.Trajectory = trajectory;
 }
예제 #13
0
 public HitTargetEventArgs(Vehicle source, Vehicle target)
 {
     this.Source = source;
     this.Target = target;
 }
예제 #14
0
 public TankBrush(Vehicle vehicle)
 {
     this.vehicle = vehicle;
     InitializeComponent();
     this.Loaded += new RoutedEventHandler(TankBrush_Loaded);
 }
예제 #15
0
파일: Round.cs 프로젝트: kindohm/tanks
 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);
 }
예제 #16
0
파일: Round.cs 프로젝트: kindohm/tanks
 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);
     }
 }
예제 #17
0
파일: Player.cs 프로젝트: kindohm/tanks
 public static void ApplyMaxHealthPowerup(Vehicle vehicle, MaxHealthPowerup powerup)
 {
     vehicle.MaxHitPoints = vehicle.MaxHitPoints + (int)((double)vehicle.MaxHitPoints * powerup.Value);
 }
예제 #18
0
 public WeaponDisplay(Vehicle vehicle)
 {
     this.vehicle = vehicle;
     InitializeComponent();
     this.Loaded += new System.Windows.RoutedEventHandler(WeaponDisplay_Loaded);
 }
예제 #19
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);
     }
 }
예제 #20
0
파일: Round1.cs 프로젝트: kindohm/tanks
 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);
 }
예제 #21
0
 public VehicleEventArgs(Vehicle vehicle)
 {
     this.Vehicle = vehicle;
 }
예제 #22
0
파일: Player.cs 프로젝트: kindohm/tanks
 public static void ApplyRateOfFirePowerup(Vehicle vehicle, RateOfFirePowerup powerup)
 {
     vehicle.RateOfFireBonus = vehicle.RateOfFireBonus + powerup.Value;
 }
예제 #23
0
 public PowerupAcquiredEventArgs(Vehicle vehicle, Powerup powerup)
 {
     this.Vehicle = vehicle;
     this.Powerup = powerup;
 }
예제 #24
0
파일: Player.cs 프로젝트: kindohm/tanks
 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));
 }