Exemplo n.º 1
0
 public Soldier(float x, float y) : base(x, y)
 {
     spritemap.Add(Animation.Idle, scene.GetAnimationString(0, 0), 5).NoRepeat();
     spritemap.Add(Animation.Throw, scene.GetAnimationString(0, 11), 4).NoRepeat();
     spritemap.CenterOrigin();
     spritemap.Play(Animation.Idle);
     runtime = (int)spritemap.Anim(Animation.Idle).TotalDuration *scene.random.Next(3, 4);
     AddGraphic(spritemap);
     scene.Add(this);
     SetHitbox(43, 42, ColliderTags.Garbage);
     Hitbox.CenterOrigin();
 }
Exemplo n.º 2
0
 public Enemy_Mummy(float x, float y) : base(x, y)
 {
     Layer          = -500;
     this.MaxHP     = scene.stage.MaxHP;
     this.CurrentHP = this.MaxHP;
     SetHitbox(35, 46, ColliderTags.EnemyUnit);
     Hitbox.SetPosition(9, 17);
     spritemap.Add(Animation.Shoot, scene.GetAnimationString(0, 21), 3).NoRepeat();
     spritemap.Add(Animation.Death, scene.GetAnimationString(22, 67), 3).NoRepeat();
     spritemap.Add(Animation.Run, scene.GetAnimationString(68, 85), 3);
     spritemap.Play(Animation.Run);
     AddGraphic(spritemap);
     scene.Add(this);
     scene.enemyList.Add(this);
     runtime = (int)spritemap.Anim(Animation.Run).TotalDuration *scene.random.Next(3, 12);
 }
Exemplo n.º 3
0
 public Enemy_Cokka(float x, float y) : base(x, y)
 {
     Layer          = -500;
     this.MaxHP     = scene.stage.MaxHP * 2;
     this.CurrentHP = this.MaxHP;
     SetHitbox(72, 57, ColliderTags.EnemyUnit);
     Hitbox.SetPosition(12, 20);
     spritemap.Add(Animation.Shoot, scene.GetAnimationString(0, 16), 4).NoRepeat();
     spritemap.Add(Animation.Death, scene.GetAnimationString(17, 25), 4).NoRepeat();
     spritemap.Add(Animation.WeaponOut, scene.GetAnimationString(32, 38), 4).NoRepeat();
     spritemap.Add(Animation.Run, scene.GetAnimationString(26, 31), 4);
     spritemap.Play(Animation.Run);
     AddGraphic(spritemap);
     scene.Add(this);
     scene.enemyList.Add(this);
     runtime = (int)spritemap.Anim(Animation.Run).TotalDuration *scene.random.Next(3, 12);
 }
Exemplo n.º 4
0
 public Enemy_Shield(float x, float y) : base(x, y)
 {
     Layer          = -500;
     this.MaxHP     = scene.stage.MaxHP / 4;
     this.CurrentHP = this.MaxHP;
     SetHitbox(33, 40, ColliderTags.EnemyUnit);
     Hitbox.SetPosition(28, 27);
     spritemap.Add(Animation.Death1, scene.GetAnimationString(0, 21), 4).NoRepeat();
     spritemap.Add(Animation.Death2, "22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 31", 4).NoRepeat();
     spritemap.Add(Animation.Death3, scene.GetAnimationString(33, 41), 4).NoRepeat();
     spritemap.Add(Animation.Death4, scene.GetAnimationString(42, 52), 4).NoRepeat();
     spritemap.Add(Animation.Death5, scene.GetAnimationString(53, 67), 4).NoRepeat();
     spritemap.Add(Animation.Death6, scene.GetAnimationString(68, 80), 4).NoRepeat();
     spritemap.Add(Animation.Death7, scene.GetAnimationString(81, 95), 4).NoRepeat();
     spritemap.Add(Animation.WeaponOut, "96-99", 4).NoRepeat();
     spritemap.Add(Animation.WeaponBack, "99-96", 4).NoRepeat();
     spritemap.Add(Animation.Idle, "100-105", 8);
     spritemap.Add(Animation.Run, "106-117", 4);
     spritemap.Add(Animation.Shoot, "118-123", 4).NoRepeat();
     spritemap.Play(Animation.Run);
     AddGraphic(spritemap);
     scene.Add(this);
     scene.enemyList.Add(this);
     runtime = (int)spritemap.Anim(Animation.Run).TotalDuration *scene.random.Next(3, 12);
 }
Exemplo n.º 5
0
 public Enemy_Soldier(float x, float y) : base(x, y)
 {
     Layer          = -500;
     this.MaxHP     = scene.stage.MaxHP / 4;
     this.CurrentHP = this.MaxHP;
     SetHitbox(33, 40, ColliderTags.EnemyUnit);
     Hitbox.SetPosition(28, 27);
     spritemap.Add(Animation.Death1, scene.GetAnimationString(0, 21), 4).NoRepeat();
     spritemap.Add(Animation.Death2, "22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 31", 4).NoRepeat();
     spritemap.Add(Animation.Death3, scene.GetAnimationString(33, 41), 4).NoRepeat();
     spritemap.Add(Animation.Death4, scene.GetAnimationString(42, 52), 4).NoRepeat();
     spritemap.Add(Animation.Death5, scene.GetAnimationString(53, 67), 4).NoRepeat();
     spritemap.Add(Animation.Death6, scene.GetAnimationString(68, 80), 4).NoRepeat();
     spritemap.Add(Animation.Death7, scene.GetAnimationString(81, 95), 4).NoRepeat();
     spritemap.Add(Animation.Throw, scene.GetAnimationString(115, 129), 4).NoRepeat();
     spritemap.Add(Animation.Idle, scene.GetAnimationString(96, 102), 5);
     spritemap.Add(Animation.Run, scene.GetAnimationString(103, 114), 4);
     spritemap.Play(Animation.Run);
     AddGraphic(spritemap);
     scene.Add(this);
     scene.enemyList.Add(this);
     runtime = (int)spritemap.Anim(Animation.Run).TotalDuration *scene.random.Next(3, 12);
 }
Exemplo n.º 6
0
 public Explosions(float x, float y, ExplosionType type, int delay, bool isVehicleDestruction) : base(x, y)
 {
     explosion_sound_library.Add(new Sound("Assets/Sounds/explosion_big.ogg")
     {
         Loop = false
     });
     explosion_sound_library.Add(new Sound("Assets/Sounds/explosion_09.ogg")
     {
         Loop = false
     });
     explosion_sound_library.Add(new Sound("Assets/Sounds/explosion_10.ogg")
     {
         Loop = false
     });
     explosion_sound_library.Add(new Sound("Assets/Sounds/explosion_11.ogg")
     {
         Loop = false
     });
     explosion_sound_library.Add(new Sound("Assets/Sounds/explosion_12.ogg")
     {
         Loop = false
     });
     this.type = type;
     this.isVehicleDestruction = isVehicleDestruction;
     sound = explosion_sound_library[scene.random.Next(1, 5)];
     if (this.type == ExplosionType.small)
     {
         spritemap = new Spritemap <Animation>("Assets/Img/Sprites/Explosions/explosion_small.png", 32, 48);
         spritemap.Add(Animation.explosion, scene.GetAnimationString(0, 27), 3).NoRepeat();
         SetHitbox(spritemap.TextureRegion.Width, spritemap.TextureRegion.Height, ColliderTags.Garbage);
     }
     else if (this.type == ExplosionType.medium)
     {
         spritemap = new Spritemap <Animation>("Assets/Img/Sprites/Explosions/explosion_medium.png", 70, 70);
         spritemap.Add(Animation.explosion, scene.GetAnimationString(0, 27), 3).NoRepeat();
         SetHitbox(spritemap.TextureRegion.Width, spritemap.TextureRegion.Height, ColliderTags.Garbage);
     }
     else if (this.type == ExplosionType.big)
     {
         spritemap = new Spritemap <Animation>("Assets/Img/Sprites/Explosions/explosion_big.png", 80, 96);
         spritemap.Add(Animation.explosion, scene.GetAnimationString(0, 27), 3).NoRepeat();
         SetHitbox(spritemap.TextureRegion.Width, spritemap.TextureRegion.Height, ColliderTags.Garbage);
     }
     else if (this.type == ExplosionType.huge)
     {
         spritemap = new Spritemap <Animation>("Assets/Img/Sprites/Explosions/explosion_huge.png", 113, 137);
         spritemap.Add(Animation.explosion, scene.GetAnimationString(0, 23), 3).NoRepeat();
         SetHitbox(spritemap.TextureRegion.Width, spritemap.TextureRegion.Height, ColliderTags.Garbage);
         Hitbox.SetPosition(0, -137 / 2);
         spritemap.SetPosition(0, -137 / 2);
         sound = explosion_sound_library[0];
         //Console.WriteLine(X + "," + Y);
     }
     else if (this.type == ExplosionType.shell_normal)
     {
         spritemap = new Spritemap <Animation>("Assets/Img/Sprites/Explosions/explosion_shell_normal.png", 60, 112);
         spritemap.Add(Animation.explosion, scene.GetAnimationString(0, 26), 3).NoRepeat();
         SetHitbox(spritemap.TextureRegion.Width, spritemap.TextureRegion.Height, ColliderTags.Garbage);
         Hitbox.SetPosition(0, -112 / 2);
         spritemap.SetPosition(0, -112 / 2);
     }
     else if (this.type == ExplosionType.shell_big)
     {
         spritemap = new Spritemap <Animation>("Assets/Img/Sprites/Explosions/explosion_shell_big.png", 68, 170);
         spritemap.Add(Animation.explosion, scene.GetAnimationString(0, 29), 3).NoRepeat();
         SetHitbox(spritemap.TextureRegion.Width, spritemap.TextureRegion.Height, ColliderTags.Garbage);
         Hitbox.SetPosition(0, -170 / 2);
         spritemap.SetPosition(0, -170 / 2);
     }
     if (isVehicleDestruction)
     {
         Hitbox.Width  *= 2;
         Hitbox.Height *= 2;
     }
     spritemap.CenterOrigin();
     Hitbox.CenterOrigin();
     this.delay = delay;
     Layer      = -600;
 }