Basic Filler engine with Box2D – part 3

Here we are with the 3rd part… this time we’ll manage collision detection.

I recommend to read step 1 and 2 before continuing.

You should how to manage collisions with Box2D, and if not go and read Understanding how Box2D manages collisions, but this time we won’t use the collision handler.

Since all collisions we have to manage are among circles, I’ll simply use the Pythagoras theorem.

The only thing that differs from the original concept is when you touch a ball or the boundaries, the ball you are drawing does not disappear but falls down. Just to make something different…

And this is the result:

You should already know ho to play…

Download the source code and make your own filler game

  • Uchiha

    This actually seems to work better than the original engine when it comes to handle the big balls collisions.

  • Thanks for posting this. It’s great to get insight into using the Box2D engine.

  • Pingback: Simplify your Box2D projects with QuickBox2D : Emanuele Feronato()

  • Santi

    Can u explain how to make the differents colours of balls and not always the sameone??
    And other thing, can u show how to take the % of that ball in the square??

    Thnx

    Santi