Esempio n. 1
0
 public void Explode()
 {
     BombFlame.Create(position, 0.5f);
     foreach (Direction direction in Enum.GetValues(typeof(Direction)))
     {
         for (int l = 1; l < bombLength + 1; l++)
         {
             IntVector2      positionToFlame = position + direction.GetIntVector2() * l;
             SuckerbanObject obj             = level.GetObjectInPosition(positionToFlame);
             if (obj is SteelWall)
             {
                 break;
             }
             if (obj is BrickWall)
             {
                 ((BrickWall)obj).Destroy();
                 break;
             }
             BombFlame.Create(positionToFlame, 0.5f);
         }
     }
     Destroy(transform.gameObject);
 }