Box2d destructible terrain demo using only geometry

Hello Box2d lovers, what I am going to show you today is something I started studying some time ago, when I focused on triangulation of polygons with holes: an engine capable of simulate destructible terrain with Box2D using only geometry, which can also be applied to any other physics engine, like NAPE.

You may say NAPE already features destructible terrain, but actually you aren’t destroying anything, you are only deleting part of a bitmap which NAPE renders with marching squares algorithm.

My destructible terrain engine uses only pure geometry, which should be a more precise way in my opinion.

I have to optimize it a bit, bacause there’s still a little bug, meanwhile look at the demo:

Click on the terrain to destroy it.

Now, imagine some awesome game concept you can make out of it.

Complete tutorial and source code available next week. Meanwhile, if you want to guess how it’s made, you’re welcome, I will be glad to answer if I did it like that.

  • Jorge

    Awesome Emanuele, simply awesome…

  • The Don


  • Rafael Lima

    Nice job.

  • Umar

    Cola & Coffee is really bad for health so stop drinking .. and btw very good job you have done here, keep up good work :)

  • Mikolaj

    I suppose you have changed source code of Box2d.

    • Emanuele Feronato

      no, mikolaj

  • Hello Emanuele,

    My name is Kevin Murray and I am looking into building a few mobile games that rewards user coupons instead of gaming points and I wanted to know if you could give me any type of advice while I get started. I am outsourcing the entire process and plan to not build any new games and to used older common games that users at some point in their life have played. These will be games branded to businesses and given away to their customers free to download from the app store and play in order to get coupons to that could be used back inside the store. I was planning on using games like Tetris, bejeweled and many basic games we all have seen at one point in our life.

  • MC

    I suppose it’s a combination of your script to intersect polygons, and create box2d polygons with the resultanting vertex?

  • Eberhardt

    Can someone please tell me how do I open the actionscript in adibe so I can begin to code?

  • Carlos Ribeiro

    You are awesome Emanuel.

  • Emanuele Feronato

    @MC: yeah!!

  • Pingback: Where’s my water Flash + Box2D demo - Emanuele Feronato()

  • Lorenzo

    Hello Emanuele,

    this is exactly what I’m looking for my new game project! Cannot wait for a tutorial!

    Grazie! :-)

  • Pingback: Digging into Box2D destructible terrain final version. Test it and enjoy. - Emanuele Feronato()

  • Pingback: How to create destructible terrain using Box2D – step 1 - Emanuele Feronato()