Box2D Vs p2.js physics in the making of “Stack the Crates” HTML5 game

Did you know Stack the Crates game, based on my Tipsy Tower prototype, has been released?

You can play it on your browser or as an Android game on, have a look both at the site and at the other games.

The physics engine which handles the game is the well known Box2D, which is available for Phaser as a premium plugin.

However, Box2D is not the only physics engine you can use in Phaser: p2.js is also available and it comes with the basic Phaser distribution.

This is “Stack the Crates” game with p2 physics:

If you have a mobile device, you can play the game directly from this link.

You have one minute to drop as many crates as you can while trying to get the highest stack possible.

And this is the source code:

The game works pretty much in the same way, but I prefer Box2D because sometimes p2.js allows some crates to penetrate throughout other crates, and although this glitch is often fixed in next frame, it’s not that good to see.

Maybe there is some way to fix it, I am open to suggestions, download the source code and have a look. And don’t forget to get the Android version of the game.