Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

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.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (23 votes, average: 4.65 out of 5)
Loading ... Loading ...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 16 comments

  1. Jorge

    on July 11, 2013 at 4:37 pm

    Awesome Emanuele, simply awesome…

  2. The Don

    on July 11, 2013 at 4:52 pm

    Nice

  3. Rafael Lima

    on July 11, 2013 at 6:52 pm

    Nice job.

  4. Umar

    on July 12, 2013 at 1:38 am

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

  5. Mikolaj

    on July 12, 2013 at 9:55 am

    I suppose you have changed source code of Box2d.

  6. Emanuele Feronato

    on July 12, 2013 at 10:09 am

    no, mikolaj

  7. Kevin Murray

    on July 13, 2013 at 7:24 am

    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.

  8. MC

    on July 14, 2013 at 2:51 am

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

  9. Eugene Krevenets

    on July 14, 2013 at 9:16 am

    sometimes we have strange square holes, like that: https://lh6.googleusercontent.com/-zf0ccJz2IUE/UeJQAKTzj-I/AAAAAAAAfkw/PpN6srp8P5Y/s0/2013-07-14_09-15-11.png

  10. Eberhardt

    on July 15, 2013 at 8:47 pm

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

  11. Carlos Ribeiro

    on July 16, 2013 at 12:52 am

    You are awesome Emanuel.

  12. Emanuele Feronato

    on July 16, 2013 at 9:45 am

    @MC: yeah!!

  13. Where’s my water Flash + Box2D demo - Emanuele Feronato

    on July 24, 2013 at 6:41 pm

    [...] I am finetuning my Box2D destructible terrain demo using only geometry, with a full tutorial about to be released, here is a Where’s my water demo, using the same [...]

  14. Lorenzo

    on July 31, 2013 at 12:51 pm

    Hello Emanuele,

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

    Grazie! :-)

  15. Digging into Box2D destructible terrain final version. Test it and enjoy. - Emanuele Feronato

    on August 2, 2013 at 3:42 pm

    [...] no wonder my most popular posts in these weeks are Box2d destructible terrain demo using only geometry and Where’s my water Flash + Box2D demo. A lot of people want to create new games with Box2D [...]

  16. How to create destructible terrain using Box2D – step 1 - Emanuele Feronato

    on October 9, 2013 at 4:16 pm

    [...] I showed you various examples of destructible terrain created with Box2D (look here, here and here), it’s time to show you the full tutorial to create destructible [...]

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×