1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

Demo & Source: Simple Box2D, with curved edges!

 

(The image above this text is actually the Flash movie, if you hadn’t guessed.  Try using your mouse to interact.  If it’s blank, then something’s gone wrong!)

I’ve been busy working on my Box2D classes again. (As before here and here.)  I’m not quite ready to go through the code with some tutorials yet, but you can download the source for this demo here.  This version has had a bit more of a proper code cleanup – I’ve un-hacked some hacks I did earlier in development, and added a few more utility functions, but most importantly this version supports SWF library asset importing of multiple shapes, and shapes with curved edges (which it couldn’t do previously).

I feel like I should put that in bold or something, because it’s probably my most-clever bit of code to date.  I’m going to settle for saying it twice though: You can import library objects with multiple shapes, and shapes with curved and straight edges.  Have a look at the screenshot below and compare it with the Box2D display;

In Flash IDE:

In Box2D:

You can download the source for this demo here.

I’m going to get this as a project on some publicly-available source repository soon.  I’d love to hear feedback on it now though!

7 Comments »

  1. Looking real good James! Nice Job!!

    Comment by reyco — 14 January 2010 #

  2. Just superb. Makes box2d something you can play with rather than wrestle with. I’m going to build something fun with this as soon as i get a minute :)

    Comment by chichlatte — 4 March 2010 #

  3. Let me know how you get on! The latest post on this is here and the source code is also available from GitHub here.

    Comment by James — 5 March 2010 #

  4. outstanding! I may branch out an update for 2.1a if it’s not already in the works in a month or two.

    Comment by T — 23 March 2010 #

  5. @T I’m not currently updating things to the 2.1 version myself, so please feel free to branch things!

    Comment by James — 24 March 2010 #

  6. Awesome post man, I borrowed your idea of importing assets from the flash IDE and integrated into my soon to be released Isometric component. http://hybridmindset.com/blog/My-PushButton-Engine-Experience-Week-2

    Comment by Lavon Woods — 19 June 2010 #

  7. Sounds like a cool idea Lavon!

    Comment by James — 21 June 2010 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: This post is over 7 months old. You may want to check later in this blog to see if there is new information relevant to your comment.