public override void Initialize() { base.Initialize(); weakShots = new ShotPool(LuxGame, World, true, 0, 20, 20, 40, 25, this.Content.Load<Texture2D>("bullet004-1")); strongShots = new ShotPool(LuxGame, World, true, 0, 30, 30, 40, 14, this.Content.Load<Texture2D>("bullet003-1")); Game.Components.Add(weakShots); Game.Components.Add(strongShots); }
public override void Initialize() { elapsed = 0; shootOrder = 0; secondShootOrder = 0; rank = 0; ShotPool redShots = new ShotPool(LuxGame, World, false, 0.3, 100, 100, shotHitBox, 15, bulletText, null); Game.Components.Add(redShots); ShotsOfType.Add(redShots); ShotPool blueShots = new ShotPool(LuxGame, World); shooter = new Enemy(LuxGame, World, 0, 0, 0, new List<ShotPool>() {blueShots}, null); shooter.Skin = new Sprite(shooter, new List<Texture2D>() { enemyTexture }, null); shooter.Skin.SetAnimation(enemyTexture.Name); Game.Components.Add(blueShots); Game.Components.Add(shooter); ShotPool bigShots = new ShotPool(LuxGame, World, false, 1.5, 150, 200, 20, 50, bigBulletText, null); bigShooter = new Enemy(LuxGame, World, 0, 0, 0, new List<ShotPool>() {bigShots}, null); bigShooter.Skin = new Sprite(bigShooter, new List<Texture2D>() { enemyTexture }, null); bigShooter.Skin.SetAnimation(enemyTexture.Name); Game.Components.Add(bigShots); for (int i = 0; i < 20; i++) { HomingMissile homingShoot = new HomingMissile(this.LuxGame, 0, false, (float)0.05, 20, 7, World, null); homingShoot.Skin = new Sprite(homingShoot, new List<Texture2D>() { bigBulletText }, null); homingShoot.Skin.SetAnimation(bigBulletText.Name); Game.Components.Add(homingShoot); Game.Components.Add(homingShoot.Skin); homingShots.Add(homingShoot); World.BadShots.Add(homingShoot); } for (int i = 0; i < 15; i++) { RotatingShot rotatingShot = new RotatingShot(this.LuxGame, World, 0, false, (float)0.02, 10, null); rotatingShot.Skin = new Sprite(rotatingShot, new List<Texture2D>() { bigBulletText }, null); rotatingShot.Skin.SetAnimation(bigBulletText.Name); Game.Components.Add(rotatingShot); Game.Components.Add(rotatingShot.Skin); rotatingShots.Add(rotatingShot); World.BadShots.Add(rotatingShot); } Game.Components.Add(bigShooter); rotationAngle = (float)0.02; currentDirectionVector = new Vector2(0, (float)2.5); remainingTimeDeterminer = 0; remainingTime = 0.3 * Math.Cos(remainingTimeDeterminer); base.Initialize(); }
public ShootingPattern(LuxGame game, ShotPool shots, Enemy enemy) : base(game) { this.shots = shots; this.enemy = enemy; }
public override void Initialize() { enemyTexture = this.Content.Load<Texture2D>("commonEnemy"); base.Initialize(); Texture2D bullet2Texture = this.Content.Load<Texture2D>("bullet002-1"); hero = new Hero(this.LuxGame, this, 100, 1, 1, 5, 2, null); Sprite heroSprite = new Sprite(hero, new List<String>() { "hero" }); hero.Skin = heroSprite; hero.Position = new Vector2(400, 400); win = new MenuWindow(this, new Vector2(10, 10), deadEnemyNumber.ToString()); winLife = new MenuWindow(this, new Vector2(640, 10), hero.Life.ToString()); winTime = new MenuWindow(this, new Vector2(250, 10), ((int)(30 - elapsed)).ToString()); ListePosition.Add(new Vector2(100, 100)); ListePosition.Add(new Vector2(700, 100)); ListePosition.Add(new Vector2(400, 100)); ShotPool shots = new ShotPool(LuxGame, this, false, 0.2, 150, 150, 8, 4, bullet2Texture, null); for (int i = 0; i < 3; i++) { ShootsHero shooter = new ShootsHero(this.LuxGame, this, shots, null); Game.Components.Add(shooter); shootsHeros.Add(shooter); } GenericEnemy enem; for (int i = 0; i < 3; i++) { enem = new GenericEnemy(LuxGame, this, 500, 10, 10, null); Sprite enemySkin = new Sprite(enem, new List<Texture2D>() { enemyTexture }, null); enem.Skin = enemySkin; enem.Skin.SetAnimation(enemyTexture.Name); enem.Position = new Vector2(400, 100); enemies.Add(enem); Game.Components.Add(enem); Game.Components.Add(enemySkin); shootsHeros[i].Associate(enem); } Game.Components.Add(shots); Game.Components.Add(hero); Game.Components.Add(heroSprite); // Phase de test shots = new ShotPool(LuxGame, this); Game.Components.Add(shots); heroSprite.SetAnimation("hero"); }
public ShootsHero(LuxGame game, World world, ShotPool shots, Enemy enemy) : base(game, shots, enemy) { elapsedSec = 0; this.world = world; }
public override void Initialize() { enemyTexture = this.Content.Load<Texture2D>("commonEnemy"); base.Initialize(); Texture2D bullet2Texture = this.Content.Load<Texture2D>("bullet002-1"); hero = new Hero(this.LuxGame, this, 200, 1, 1, 5, 2, null); Sprite heroSprite = new Sprite(hero, new List<String>() { "hero" }); hero.Skin = heroSprite; hero.Position = new Vector2(400, 400); ListePosition.Add(new Vector2(100, 100)); ListePosition.Add(new Vector2(700, 100)); ListePosition.Add(new Vector2(400, 100)); ShotPool shots = new ShotPool(LuxGame, this, false, 0.2, 150, 150, 8, 4, bullet2Texture, null); GenericEnemy enem; for (int i = 0; i < 3; i++) { enem = new GenericEnemy(LuxGame, this, 500, 10, 10, null); Sprite enemySkin = new Sprite(enem, new List<Texture2D>() { enemyTexture }, null); enem.Skin = enemySkin; enem.Skin.SetAnimation(enemyTexture.Name); enem.Position = new Vector2(400, 100); enemies.Add(enem); Game.Components.Add(enem); Game.Components.Add(enemySkin); } foreach (Enemy enemy in enemies.ToList<Enemy>()) { Game.Components.Add(new ShootsHero(this.LuxGame, this, shots, enemy)); } Game.Components.Add(shots); Game.Components.Add(hero); Game.Components.Add(heroSprite); // Phase de test shots = new ShotPool(LuxGame, this); Game.Components.Add(shots); heroSprite.SetAnimation("hero"); }