|
Project Information
Members
Featured
Downloads
Links
|
OverviewThis is a port of Box2DFlash 2.1a to JavaScript. I developed an ActionScript 3 -to- JavaScript converter to generate the code. There already exists a port to JavaScript called Box2dJs, but it's not up-to-date and you have to import a big amount of JavaScript files in every project, whereas my version is stored in a single file. The Box2D physics engine was developed by Erin Catto (visit http://www.gphysics.com for further information) Live DemoUsageYou can read the documentation for Box2dFlash, since nearly everything is organized the same way. http://www.box2dflash.org/docs/2.1a/reference/ The b2DebugDraw takes a canvas-context instead of a Sprite: var debugDraw = new Box2D.Dynamics.b2DebugDraw;
debugDraw.SetSprite(document.GetElementsByTagName("canvas")[0].getContext("2d"));
|