Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

Box2DFlash 2.1a released – what changed

Some days ago Boris the Brave released the new version of the popular physics library.

There are some critical changes that won’t make old projects run in the new environment.

The most important ones are:

  • It is now not necessary to specify a size for your world, it’ll always be large enough.
  • Improved collisions system
  • You must specify if a body is dynamic, no matter if its mass is greater than zero
  • Fixtures now determine material properties of shapes, such as density, friction and so on

But I think an example will be more explicative than a thousand words, so I created a simple vehicle you can control with left and right arrow keys. It uses revolute joints and motors.

This is the code you would need in the old Box2D version

Take a look at the compiler errors…

And this is the new one. All changes are commented.

Download the source code, new library included.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (22 votes, average: 4.77 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 19 comments

  1. Luiz Fernando

    on January 27, 2010 at 5:33 pm

    Hmm nice. I’ll check it to see if there was any substantial changes on the engine itself…

  2. Bindiry

    on January 27, 2010 at 8:53 pm

    I only hope release it early.

  3. Vlad

    on January 28, 2010 at 7:43 am

    So basically, Emanuelle, if we try to use this version of box2das3 with your previous tutorials… ouch.

  4. Rackdoll

    on January 28, 2010 at 2:38 pm

    thnx for this tut. Was wondering what i did wrong with all those compiler errors. Now i see the finer of it. Good.
    Keep on the tuts \o/

    Rackdoll

  5. ricky

    on January 28, 2010 at 3:11 pm

    Actually, I was about to learn Box2d yesterday and grabbed a copy of your Box2d for absolute beginners when I got surprised that I got lots of errors.I was really disappointed…how come the hello world of Borris don’t seem to work?

    Will you do a Box2d for absolute beginners the updated version. I was really waiting for your post on the new Box2d changes. Thanks you make complicated things sound simple.You could be a professor.:)

  6. rishabh

    on January 28, 2010 at 5:19 pm

    @ricky
    he is like a professor to me

    i liked the fixtures and all
    got major reusability made now

    but i think we need another begginer tut on this =[

    about the old projects thing

    if you have time rename the new version to Box2DA and then change it each and every class
    thats what i did so my older projects work (they are not that old but i downloaded the new source today)

  7. Monkios

    on January 28, 2010 at 9:25 pm

    Nice …

    So the guy made a version of his thing wich is not backward-compatible ?

    How unuseful !

  8. rishabh

    on January 29, 2010 at 1:00 pm

    minkios:
    it isn’t unuseful at all , it has a lot of changes which help,though i haven’t looked into all

  9. ozdy

    on January 30, 2010 at 9:18 pm

    Hi guys, sounds great.
    Any idea if the flash 10 version has performance enhancements (like using vectors)?

  10. Oscar

    on January 31, 2010 at 4:27 am

    HI, looks some code is gone, like boundaryListener how this works now? some idea? Thanks.

  11. akipponn

    on February 1, 2010 at 12:03 pm

    Hi, what a great entry! This page is so helpful.

    from Kyoto, Japan :-)

  12. Box2dflash 2.1a ??????????????????????? | aki note

    on February 1, 2010 at 12:58 pm

    [...] Box2dflash ? C++ ??????????? Box2d ? Flash ??????????????2008 ??????????????????????????????????????????????????????????????????????????????????? BOX2DFLASH 2.1A RELEASED – WHAT CHANGED @ EMANUELE FERONATO » italian geek and PROgrammer http://www.emanueleferonato.com/2010/01/27/box2dflash-2-1a-released-what-changed/ [...]

  13. box2d flash new release + a minimal sample | aki note

    on February 1, 2010 at 1:58 pm

    [...] http://www.emanueleferonato.com/2010/01/27/box2dflash-2-1a-released-what-changed/ [...]

  14. Box2D tutorial for the absolute beginners – revamped : Emanuele Feronato - italian geek and PROgrammer

    on February 2, 2010 at 1:01 am

    [...] 2.1 release, a lot of things changed, so it’s time to publish another tutorial for the absolute [...]

  15. Create incredible particle effects with Partigen 2 : Emanuele Feronato - italian geek and PROgrammer

    on February 8, 2010 at 12:22 pm

    [...] In this example, I am going to create a particle effect with the user interface provided in the component, then I’ll export it with XML and finally add it “on the fly” to the Box2D car example. [...]

  16. Understanding Box2D’s one-way platforms, aka CLOUDS : Emanuele Feronato - italian geek and PROgrammer

    on March 2, 2010 at 1:24 am

    [...] of the new features introduced with Box2D 2.1a is the improved contact listener class which comes in hand when we want to create one-way [...]

  17. sergey

    on April 28, 2010 at 7:37 pm

    please explain how works new collisions and how a i can catch them

  18. la

    on November 22, 2010 at 4:39 am

    You really saved newbies’ lives!

  19. Viktor

    on September 4, 2011 at 8:12 pm

    mistake on line 80

    80 fixtureDef.density=0.1;// was circleDef.restitution=0.1;