Box2D Module Changed
I’ve replaced the Box2D module in cocos2d-javascript. Previously it was using a slightly modified version of box2dweb, but it’s now using Box2D.js. The reason for this change is mostly due to Box2D.js working as a CommonJS module without any modifications at all.
If you’re interested in using Box2D.js outside of cocos2d-javascript you can find it on github at https://github.com/HBehrens/box2d.js. It comes with the latest version of cocos2d-javascript so you don’t need to do anything. Just require('box2d') and away you go.
I’ve updated the source code for the demo. You can find that on github at https://github.com/ryanwilliams/cocos2d-demo-box2d.
Comments
“due to Box2D.js being based on a newer version of Box2D”
Actually, if Box2d.js is a port of Box2dFlash, there is no newer version than 2.1a which was used when I created the Box2dWeb-port.
Can you please edit this part, since it has always been my main intention to keep box2dweb up-to-date. That’s why I’ve putted all the effort into the as3 to js compiler development.
Ahh right you are, my mistake. I’ve updated the post. Sorry about that.
Hi, there is no kind of documentation about Box2dJs?? I mean in flash to make a shape I can use this code:
var def:b2CircleDef;
def.radius = 1.5;
def.localPosition.Set(1.0, 0.0);
How would be this in js version?
Can anyone link a wiki or some documentation?
Hi, there is no kind of documentation about Box2dJs?? I mean in flash to make a shape I can use this code:
var def:b2CircleDef;
def.radius = 1.5;
def.localPosition.Set(1.0, 0.0);
How would be this in js version?
Can anyone link a wiki or some documentation?
Sorry, but commenting has been disabled on this article due to a high amount of spam bots hitting it.