Create a Flash game like iOS Pop to Save using Box2D

During these days I am playing a nice free physics iOS game called Pop to Save developed by Cetin Caglar.

The game combines physics with line drawing and erasing, like Way of an Idea, but enriches the gameplay with particles.

Since Way of an Idea prototype has already been discussed in this post, with some easy changes to the code we can have a working prototype of Pop to Save, try it by yourself:

You have to repeatedly hit the orange receiver with the spheres generated by the blue emitter. The receiver will absorb spheres until it explodes releasing them, and another emitter is randomly created.

MOUSE OVER the emitter to shoot spheres

CLICK AND DRAG mouse pointer to draw terrain

MOUSE OVER the terrain while keeping SPACEBAR pressed to delete terrain.

To make things easier and avoid unnecessary tasks, I am not using Box2D contact listeners to check for collisions, but only some trigonometry.

Here is the commented script, uncommented parts are taken from the original post so it won’t be a problem for you to figure out how it works.

If you have any question, feel free to leave a comment, meanwhile download the source code and get the original game for free.

  • MC

    Cool… i love the box2D prototypes

  • Great thanks for this article.

    By the way, Cetin Caglar is publisher :D

  • Enjoyed the game so much. I played it 20 minutes straight while at the office haha.

  • mahongquan

    good game,i like it.

  • Wow, thank you for sharing! I always thought that such a cool game requires huge bunch of code,, but now it seems that developing it absolutely possible even for one person!

  • Hello, Emanuele feronato. after writing the codes, what will I do?

  • nice share~!
    I want to know how to let the line more smooth@@?