2D Map destruction

Hey guys,

I’m looking for some guides or tutorials to make a 2D map with destruction, but I didn’t found nothing.

Anyone know how do I can create anything just like the image below ?

I want to destroy a part of my plataform where my objects / shots collide, but I will have a custom background behind, which I need to show after some parts being destroyed.

Regards,

Thanks for any help!

not sure this is possible.
Unless you create like thousands of little cubes and code it when player hits the ground, cubes in radius 1m get destroyed.

this one uses texture:

i think i’ve seen mesh version somewhere in the forums also (could create holes etc)

1 Like

Looks like you want to recreate terrain from Worms.

Easiest way is to keep a pixel mask of the entire terrain and update a terrain texture after explosions. To improve performance you would have to split up the texture into smaller pieces so that texture uploads to video memory wouldn’t take too long per explosion. You can of course do this at any resolution - doesn’t have to be pixel perfect.

Integrating this with physics is a much harder challenge. If you only need simple physics functionality like that found in early Worms games, you could write your own “raycasting” on that pixel mask.

1 Like

@TomasJ , that is exactly what I want.

I Will look for a pixel mask tutorial to study and try to do it.

Thank you very much!

Thank you to you all too, @mgear and @Wrymnn

You can also achieve this using procedural meshes (like a 2D voxel terrain). I’m working on something along those lines ( http://www.6stringsand16bits.com/ - if you scroll down a bit there’s the first part of a brief overview of how it works, I’ve yet to write the follow up pieces).

But probably better is these really good tutorials that explain this stuff in some detail, check this forum post: