Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

“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.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 5.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 5 comments

  1. Pete

    on January 16, 2013 at 6:36 pm

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

  2. Peter

    on January 16, 2013 at 10:20 pm

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

  3. “Hundreds” Flash game prototype using Box2D – Emanuele Feronato « eaflash

    on January 17, 2013 at 10:28 am

    [...] on http://www.emanueleferonato.com Share this:TwitterFacebookLike this:LikeBe the first to like [...]

  4. Rennan

    on January 17, 2013 at 4:00 pm

    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,

  5. Flash Games

    on March 20, 2013 at 7:48 am

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