Please note that this is experimental code! If you use this please let me know and give Erin Catto and me some credit.
You can see a demo of it in action here. You can click to trigger an explosion. On my notebook the demo runs fluidly in chrome. In firefox 3.5 it is pretty slow. In the current nightly it runs smooth as well. So I guess firefox is slowly catching up. Oh and just forget about IE.
The explosions in the demo are simulated by shooting out a few tracer particles with a high density and velocity. The benefit over just applying an impulse to each object is that the strength of the impulse is proportional to the surface area. Also the force of the explosion will to some extend be redirected to the side by the floor. When using this in production code you would probably want to destroy this tracer particles after their first collision or a few seconds.
I compiled a single file version of the script using googles closure compiler. box2d.js.
The zip file contains the actionscript source, the conversion script and a patch to fix some of the things the conversion script misses. box2d2.zip
I didn't write any. But you can use the documentation of box2dflash.comments powered by Disqus