I spent some time over the weekend adding Box2D physics to the JavaScript version of my endless runner prototype. As you can see from the video below, you can now interact with our little hero, making him run and jump between platforms (once again, apologies about the terrible camera work).

The demo may still be fairly rudimentary but I was nevertheless suitably impressed by the performance of Box2dWeb. While it’s certainly not as fast as the ActionScript 3 port of Box2D, my ageing PC with its i3 processor was still able to comfortably run everything at 60fps. If asm.js ever gains some traction however, there’s a real possibility that we could start to see near native-like speeds from certain JavaScript libraries in the future. Now that would be a mouth watering prospect.

  1. Looks good!

    Are you thinking on making a tutorial on making box2d and pixijs work together?

    Karl
  2. Hi Karl. Yeah I have been planning to do a few tutorials based around PixiJS and hopefully Box2D too. Unfortunately it’s proving extremely difficult to find the time at the moment. I’ll see what I can do though.

    Christopher (Author)
  3. Do you have any tutorial on this? Or do you have this code on github? I’m having problems on the integration of Box2D on the pixijs code…

    RC