public Missile(Vector2 Position, Vector2 Speed, AnimatedSprite Clone, Color[] Mask) : base(Position, Speed, 0, 0, Clone, Mask) { if (SuperTank2.Difficulty == DifficultyChoices.Normal) { Resist = 3; Damage = 4; } else if (SuperTank2.Difficulty == DifficultyChoices.Hard) { Resist = 5; Damage = 9; } else if (SuperTank2.Difficulty == DifficultyChoices.Expert) { Resist = 8; Damage = 12; } Angle = (float)Math.Atan2(Speed.Y, Speed.X); Near = null; float DistanceMin = float.MaxValue; for (int V = 0; V < Vehicule.ArrayVehicule.Length; V++) { float Distance = Vector2.Distance(Position, Vehicule.ArrayVehicule[V].Position); if (Distance < DistanceMin) { DistanceMin = Distance; Near = Vehicule.ArrayVehicule[V]; } } }
public override void Destroyed(Vehicule Owner) { for (int i = 0; i < Owner.ArrayWeaponSecondary[0].WeaponSpecial; i++) { Owner.AddBullet(new FlakFragment(Position)); } }
public override void Destroyed(Vehicule Destroyer) { ActiveLaser.Resist = 0; IsAlive = false; if (Destroyer == null) { return; } for (int i = 0; i < 10; i++) { new FlameParticle(Position, SuperTank2.Randomizer.Next(360) * SuperTank2.DegToRad, SuperTank2.Randomizer.NextDouble() * 5).AddParticule(); } if (SuperTank2.Randomizer.Next(10 - ((int)SuperTank2.Difficulty * 4)) == 1) { PowerUp.AddPowerUp(new PowerUp(new Vector2(Position.X, Position.Y), PowerUp.ArrayPowerUpChoice[SuperTank2.Randomizer.Next(18)])); } Explosion.AddExplosion(new Explosion1(Position, 0, 0)); for (int i = 0; i < 4; i++) { Smoke.AddSmoke(new PlaneSmoke(Position, (float)(Math.Sign(Speed.X) * Math.PI - 10 * SuperTank2.DegToRad + SuperTank2.Randomizer.Next(20) * SuperTank2.DegToRad), 1 + SuperTank2.Randomizer.Next(4))); } if (SuperTank2.Difficulty == DifficultyChoices.Normal) { Destroyer.Points += 20; Destroyer.Argent += 10; } else if (SuperTank2.Difficulty == DifficultyChoices.Hard) { Destroyer.Points += 30; Destroyer.Argent += 15; } else if (SuperTank2.Difficulty == DifficultyChoices.Expert) { Destroyer.Points += 40; Destroyer.Argent += 20; } }
public override void Destroyed(Vehicule Destroyed) { for (int i = 0; i < 5; i++) { new FlameParticle(Position, SuperTank2.Randomizer.Next(360) * SuperTank2.DegToRad, SuperTank2.Randomizer.NextDouble() * 5).AddParticule(); } if (SuperTank2.Difficulty == DifficultyChoices.Normal) { Destroyed.Points += 20; Destroyed.Argent += 20; } else if (SuperTank2.Difficulty == DifficultyChoices.Hard) { Destroyed.Points += 30; Destroyed.Argent += 30; } else if (SuperTank2.Difficulty == DifficultyChoices.Expert) { Destroyed.Points += 40; Destroyed.Argent += 40; } }
public override void Load() { ActiveVehicule = Vehicule.ArrayVehicule[0]; LoadShop(); BackgroundMusic = new FMODSound(FMODSystem, "Content/Maps/BGM/BGM_Shop.mp3"); BackgroundMusic.SetLoop(true); BackgroundMusic.PlayAsBGM(); fntArial13 = Content.Load <SpriteFont>("Fonts/Arial13"); fntArial15 = Content.Load <SpriteFont>("Fonts/Arial15"); SprShopAmeliorer = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/ShopAmeliorer"); SprShopAmeliorerP = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/ShopAmeliorerP"); Shop_monter = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Shop_monter"); Shop_descendre = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Shop_descendre"); Cursor = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Misc/Crosshair 2"); Background = Content.Load <Texture2D>("Animations/Backgrounds 3D/Shop"); VehiIco = new Texture2D[2]; VehiIco_p = new Texture2D[2]; VehiIco[0] = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Tank"); VehiIco_p[0] = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Tank_p"); VehiIco[1] = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Pickup"); VehiIco_p[1] = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Pickup_p"); sprBoutonChoice = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Shop_choix"); sprBoutonChoiceP = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/Shop_choix_p"); sprWeaponIcons = new Texture2D[10, 2]; sprWeaponIconsP = new Texture2D[10, 2]; for (int j = 0; j < 2; j += 1) { for (int i = 0; i < 10; i += 1) { sprWeaponIcons[i, j] = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/TankCanon" + i); sprWeaponIconsP[i, j] = Content.Load <Texture2D>("Animations/Bitmap Animations/Super Tank 2/Shop/TankCanon_p" + i); } } }
public override void Destroyed(Vehicule Destroyer) { for (int i = 0; i < 5; i++) { new FlameParticle(Position, SuperTank2.Randomizer.Next(360) * SuperTank2.DegToRad, SuperTank2.Randomizer.NextDouble() * 5).AddParticule(); Smoke.AddSmoke(new PlaneSmoke(Position, (float)(Angle - 10 * SuperTank2.DegToRad + SuperTank2.Randomizer.Next(20) * SuperTank2.DegToRad), 1 + SuperTank2.Randomizer.Next(4))); } if (SuperTank2.Difficulty == DifficultyChoices.Normal) { Destroyer.Points += 6; Destroyer.Argent += 3; } else if (SuperTank2.Difficulty == DifficultyChoices.Hard) { Destroyer.Points += 10; Destroyer.Argent += 5; } else if (SuperTank2.Difficulty == DifficultyChoices.Expert) { Destroyer.Points += 16; Destroyer.Argent += 8; } }
public abstract void Destroyed(Vehicule Destroyer);
public override void Destroyed(Vehicule Destroyed) { }
public override void Update(float TimeEllapsed) { if (AttackType == AttackTypes.None) { if (Position.X <= 104) { Speed.X = SpeedX * TimeEllapsed; } else if (Position.X >= 920) { Speed.X = -SpeedX * TimeEllapsed; } --AttackTypeTimer; if (AttackTypeTimer <= 0) { UpdateAttackTypeTimer(); } } else if (AttackType == AttackTypes.Missiles) { --MissilesTimer; if (MissilesTimer <= 0) { UpdateMissilesTimer(); } ++MissilesPhaseTimer; if (MissilesPhaseTimer >= 150) { MissilesPhaseTimer = 0; AttackType = AttackTypes.None; } if (Position.X <= 507) { Speed.X = SpeedX * TimeEllapsed; } else if (Position.X >= 518) { Speed.X = -SpeedX * TimeEllapsed; } else { Position.X = 512; Speed.X = 0; } } else if (AttackType == AttackTypes.Laser) { LaserPhaseTimer += 1; if (LaserPhaseTimer < 90) { new LaserParticle(new Vector2(Position.X - 20 + SuperTank2.Randomizer.Next(40), Position.Y + 118), SuperTank2.Randomizer.Next(360) * SuperTank2.DegToRad, SuperTank2.Randomizer.NextDouble() * 5).AddParticule(); } else if (LaserPhaseTimer == 90) { ActiveLaser = new LaserWeapon(new Vector2(Position.X, Position.Y + 111)); EnemyAttack.AddEnemyAttack(ActiveLaser); } else if (ActiveLaser.Lifetime <= 0) { LaserPhaseTimer = 0; AttackType = AttackTypes.None; } Vehicule Near = null; float DistanceMin = float.MaxValue; for (int V = 0; V < Vehicule.ArrayVehicule.Length; V++) { float Distance = Vector2.Distance(Position, Vehicule.ArrayVehicule[V].Position); if (Distance < DistanceMin) { DistanceMin = Distance; Near = Vehicule.ArrayVehicule[V]; } } if (Position.X <= Near.Position.X - Speed.X) { if (LaserPhaseTimer < 90) { Speed.X = SpeedX * 0.6f * TimeEllapsed; } else { Speed.X = SpeedX * 0.2f * TimeEllapsed; } } else if (Position.X >= Near.Position.X + Speed.X) { if (LaserPhaseTimer < 90) { Speed.X = -SpeedX * 0.6f * TimeEllapsed; } else { Speed.X = -SpeedX * 0.2f * TimeEllapsed; } } else { Position.X = Near.Position.X; Speed.X = 0; } } Position += Speed; UpdateTransformationMatrix(); if (ActiveLaser != null) { ActiveLaser.Position.X = Position.X; } if (Resist <= 0) { if (Destroy > 0) { Destroy--; new FlameParticle(new Vector2(Position.X + SuperTank2.Randomizer.Next(300) - 150, Position.Y + SuperTank2.Randomizer.Next(100) - 50), Vector2.Zero).AddParticule(); } else { IsAlive = false; } } }
public override void Destroyed(Vehicule Destroyer) { throw new NotImplementedException(); }
public virtual void Destroyed(Vehicule Owner) { }
public override void Destroyed(Vehicule Owner) { }