Example #1
0
 /// <summary>
 /// causes the building to explod destrroying the terrain in the process
 /// </summary>
 /// <param name="grid"></param>
 /// <param name="TerrainDestruction"></param>
 /// <param name="amountOfExplosions"></param>
 public void Destruction(Grid grid, int TerrainDestruction, int amountOfExplosions)
 {
     for (int i = 0; i < amountOfExplosions; i++)
     {
         _missileManager.AddExplosion(new Vector2(_rand.Next(_rect.Left, _rect.Right), _rand.Next(_rect.Top, _rect.Bottom)), 50 + _rand.Next(0, 200), new Color(115, 30, 30, 30));
     }
     for (int i = 0; i < TerrainDestruction; i++)
     {
         grid.ImpactPosion(new Vector2(_rand.Next(_rect.Left - 10, _rect.Right + 10), _rand.Next(_rect.Bottom - 10, _rect.Bottom + 10)), 10);
     }
     _dead = true;
 }
Example #2
0
 public override void Collision()
 {
     _missileManager.AddExplosion(_location, 200, new Color(115, 155, 155, 255));
     base.Collision();
 }