Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

“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 ...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
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.

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×