Box2d destructible terrain demo using only geometry

Emanuele Feronato Actionscript 3, Box2D, Flash

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.

From null to full HTML5 cross platform game

I will take you by hand from the bare bones of JavaScript programming through the creation of a full cross platform HTML5 game, with detailed explainations and source code.

If you don't know where to start, then From null to full HTML5 cross platform game is the book for you.

Comments 16

  1. Umar

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

    1. Post
  2. Kevin Murray

    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.

  3. MC

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

  4. Post
  5. Pingback: Where’s my water Flash + Box2D demo - Emanuele Feronato

  6. Lorenzo

    Hello Emanuele,

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

    Grazie! :-)

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

  8. Pingback: How to create destructible terrain using Box2D – step 1 - Emanuele Feronato

Leave a Reply

Your email address will not be published. Required fields are marked *