Simulate planet gravity with Phaser + Box2D as seen on Angry Birds Space

I am sure you are playing Angry Birds Fight! during these days. I do, and having a new Angry Bird game on my phone reminded me of the old Angry Birds Space and the AS3+Box2D tutorial I made three years ago.

Following the same concept, I made the same thing using Phaser and the Box2D plugin. This is what I created with just a few lines:

Here we have two planets with their gravity zones, click anywhere on the stage to place a crate and watch it fall on the planet or remain floating in the space.

The source code is really easy:

And here we have our planet gravity made with Phaser and Box2D. As usual you can download the source code.

  • Alain

    It does not seem to work with ipad / ios 8

    I got only white area floating ..

  • Alain

    Oops sorry..

    It worked on reloading the page..

    By the way, thanks again for your excellent tutorials ! ????

  • Gideon

    Hi i have implmented it , it works fine .

    How to move the object in a circular motion along with the gravity