Наследование: Character
Пример #1
0
 public override void Initialize()
 {
     base.Initialize();
     shootNb = 0;
     shooter = new Enemy(LuxGame, World, 10, 10, 10, null);
     shooter.Skin = new Sprite(shooter, new List<Texture2D>() { enemyTexture }, null);
     shooter.Skin.SetAnimation(enemyTexture.Name);
     shooter.Position = new Vector2(400, 100);
     Game.Components.Add(shooter);
     Vector2 vect = Vector2.Normalize(new Vector2(Common.Rand.Next(-2, 2), 10));
     //for (int i = 0; i < 2; i++)
     //{
     //    commonEnemies.Add(new RotatingEnemy(this.LuxGame, 1, 1, 1, null, 50, -10 + 20 * i, vect, 0.2, 4, 90, 150));
     //    commonEnemies[i].Skin = new Sprite(commonEnemies[i], new List<Texture2D>() { enemyTexture }, null);
     //    commonEnemies[i].Skin.SetAnimation(enemyTexture.Name);
     //    commonEnemies[i].Position = new Vector2(300 + i * 200, 100);
     //    // Il faut appliquer "SetAnimation" au sprite pour qu'il affiche quelque chose.
     //    Game.Components.Add(commonEnemies[i]);
     //}
     vect = new Vector2(0, 1);
     //for (int i = 2; i < 4; i++)
     //{
     //    commonEnemies.Add(new RotatingEnemy(this.LuxGame, 1, 1, 1, null, 90, 11 - 22 * (i - 2), (float)1.5 * vect, 0.2, 4, 90, 100));
     //    commonEnemies[i].Skin = new Sprite(commonEnemies[i], new List<Texture2D>() { enemyTexture }, null);
     //    commonEnemies[i].Skin.SetAnimation(enemyTexture.Name);
     //    commonEnemies[i].Position = new Vector2(300 + (i - 2) * 200, 100);
     //    // Il faut appliquer "SetAnimation" au sprite pour qu'il affiche quelque chose.
     //    Game.Components.Add(commonEnemies[i]);
     //}
     //for (int i = 4; i < 6; i++)
     //{
     //    int horiz = Common.Rand.Next(1, 4);
     //    commonEnemies.Add(new RotatingEnemy(this.LuxGame, 1, 1, 1, null, 260, 2 * (9 - 18 * (i - 4)) / 5, (float)2.5 * Vector2.Normalize(new Vector2(horiz * (1 - 2 * (i - 4)), 10)), 0.05, 2, 180, bulletTexture3, 120, 5));
     //    commonEnemies[i].Skin = new Sprite(commonEnemies[i], new List<Texture2D>() { enemyTexture }, null);
     //    commonEnemies[i].Skin.SetAnimation(enemyTexture.Name);
     //    commonEnemies[i].Position = new Vector2(400, 80);
     //    // Il faut appliquer "SetAnimation" au sprite pour qu'il affiche quelque chose.
     //    Game.Components.Add(commonEnemies[i]);
     //}
 }
Пример #2
0
 public override void Initialize()
 {
     elapsed = 0;
     shootOrder = 0;
     rank = 0;
     shooter = new Enemy(LuxGame, World, 0, 0, 0, null);
     shooter.Skin = new Sprite(shooter, new List<Texture2D>() { enemyTexture }, null);
     shooter.Skin.SetAnimation(enemyTexture.Name);
     Game.Components.Add(shooter);
     warning = new Enemy(LuxGame, World, 0, 0, 0, null);
     warning.Skin = new Sprite(warning, new List<Texture2D>() { warningTexture }, null);
     warning.Skin.SetAnimation(warningTexture.Name);
     warning.Position = new Vector2(-40, -40);
     Game.Components.Add(warning);
     bigShooter = new Enemy(LuxGame, World, 0, 0, 0, null);
     bigShooter.Skin = new Sprite(bigShooter, new List<Texture2D>() { enemyTexture }, null);
     bigShooter.Skin.SetAnimation(enemyTexture.Name);
     for (int i = 0; i < 20; i++)
     {
         HomingMissile homingShoot = new HomingMissile(this.LuxGame, 0, false, (float)0.05, 20, 1, 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);
     }
     Game.Components.Add(bigShooter);
     rotationAngle = Common.Rand.Next(0, 300);
     currentDirectionVector = new Vector2(0, (float)1.5);
     currentAccelVector = new Vector2(1, 0);
     base.Initialize();
 }
Пример #3
0
 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;
 }
Пример #5
0
 public void Associate(Enemy enemy)
 {
     this.enemy = enemy;
     elapsedSec = 0;
 }
Пример #6
0
 public ShootsHero(LuxGame game, World world, ShotPool shots, Enemy enemy)
     : base(game, shots, enemy)
 {
     elapsedSec = 0;
     this.world = world;
 }