Creating 'worms'-like terrain

Hi all,

I am fairly new to Unity (only made 2 2d games) and for my next project I want to try and create a terrain generation script to make worms-styled terrain.

My first thoughts was having a 2d array of x and y coordinates with either a 1 or 0 for solid or empty and them somehow using that to render some type of texture with a collider around it. Also, this image doesn’t show it but the terrain is destructible too.

My question is, is my idea for a 2d array of x and y coordinates with 1’s and 0’s a good idea and how could I display that in a textured way like in the image. Or, what is a better approach?

I know this is a bit late and you probably already found a way but I post this for the people who are still searching for an awnser.

I have been looking into this for about a day and found a way to do it in 2d.

First you have to make 2 objects,
1 for the terrain
1 for the damage

Give them Composite Colliders.
Add all the terrain colliders to the composite collider of the terrain object.
And do the same for the explosions when they are created.

Now when a rocket is fired give him the following code:

public Collider2D world;
public Collider2D explosionDamage;
public GameObject explosion;

void Update () {
	if(_barrier.OverlapPoint(transform.position) && !_explosionDamage.OverlapPoint(transform.position)) {
		GameObject spawnedExplosion = Instantiate(_explosion, transform.position, Quaternion.identity, _explosionDamage.transform);
		Destroy(this.gameObject);
	}
}

Now add a sprite mask to the explosion objects and say that the world can only be seen outside of the explosion.

I hope this helps and I hope you don’t mind my spelling mistakes.