“Hundreds” Flash game prototype using Box2D

Did you play iOS Hundreds game? It’s basically the remake of Hundreds Flash game which wasn’t made with Box2D as far as I can see from the way it handles collisions, so we are going to improve it with the power of Box2D.

The aim of the game is simple: make the ball numbers increase to reach a hundred by touching it with the mouse. Do not grow balls when they touch each other.

In this first step, the game features are:

* There are a number of circles moving at a constant speed and colliding each other
* You can make a circle grow by touching it with the mouse

The prototype uses concepts we have already seen in other games, check the Filler Box2D prototype to make Box2D bodies move at a constant speed and the new Way of an Idea prototype to detect bodies under the mouse.

Here is the code:

In this prototype there is a limit to circle growth because I still have to check for collisions and I don’t want circles to get bigger than the screen. This is the result:

Move the mouse over a circle to make it grow.

Download the source code.

Next time, the complete prototype with the count to 100 and the collision management.

  • Pete

    Now make make it run on ios with a reasonable framerate. . .

  • Peter

    A bit of a waste, to use a physics engine, just for circle collision.

  • Pingback: “Hundreds” Flash game prototype using Box2D – Emanuele Feronato « eaflash()

  • Rennan

    Hi Emanuele, how are you? I have a question for you. I´m trying to build a pool game and your tutorials helped me a lot to figure out somethings. But, How can I simulate a view from the top? Like in a pool table. Regards,

  • nice code thank you. now on to build my flash game.