Develop a Flash game like Angry Birds using Box2D

Here we are with one of the most famous games running on your iPhone/iPad… Rovio‘s Angry Birds!

A lot of developers criticize this title, saying it’s just a clone of “shoot something to destroy something using physics”, but what can I say? It’s fun.

So don’t be envy and let’s start understanding how does the sling work.

I wrote a quick and quite messy code just as a pre-release, I will probably adjust something and explain the code tomorrow, but for all you “gimme the code now, I can read it”, here it is the sling:

And this is the result:

… you should know how to play… drag the bird to fire it with the sling.

Download the source code.

  • Excelent post!! I also made a game using box2d, about rescuing 33 Chilean miners … check it out on http://mavari.cl/MinersHero.html

    Regards

  • Very nice!
    Two “newer” games on the android market are “bunny shooter” and “early bird”, which use the same basic concepts of angry birds, but they are at the top downloaded!

    So learning how to make your own angry birds like game would be helpful for any developer.

    I love all the box2d tutorials!

  • Kalle

    This looks cool:) Can you also say how the objects breaking is done in this game(do they use animations for breaking?). It would be very useful. Thanks.

  • kek

    Do you know QuickBox2D ?
    I like using it, you have very few code lines compared to box2D.

    http://actionsnippet.com/?page_id=1391

  • wow nice tutorial great job again !

  • Scott

    Haha I suggested this :D:D:D:D:D:D:D:D:D:D:D:D:D

  • Now there will be new clones of Angry Birds))

  • XD

    when i was aiming i hit the wall -_-‘

  • By the Gods!

  • Nice !

    Just curious how to setup the scrolling for following balls.

  • Kirtimaan

    Thanks for nice share as always. Do you have any plan to expand this tutorial a bit further, like dealing with camera motion and world panning?

  • Arindam

    Very good..I love the tutorials…

    I want to develop a thing like in catch the candy (iphone). How they are making a stretchable Hand.. of a player..
    Can you please tell me.

  • Fantastic, very nice

  • robertjoseph

    Hi, I’m not a developer, but I am looking for someone to produce one game – and then probably a second. The first project would involve taking an elephant across various obstacles, and through a number of levels. The budget is not high (it’s intended to help promote a small brand) but we’re not looking for a highly sophisticated game. Ideally it would be developed for IOS and android. Can anyone help please?

  • Great choice for a game tutorial, I know a lot of people would love to learn the mechanics behind the beloved Angry Birds! Even though I am one of those developers you mentioned who “criticize this title, saying it’s just a clone of “shoot something to destroy something using physics”, I still admit it’s a fun game and a perfect application of Box2D at its best :)

  • This is how we learn and improve. Once we are able to remake the game, we should be able to improve the game and bring up the fun part to a higher level. I’m hoping to see a better game coming out.

  • MC

    Emanuele, this is a feature requested by many
    and it should not be too difficult for you:
    You should use some script to hide/show the flash_preview
    (specially when you post more than one flash_movie in the same page)
    and you should be able to reload/refresh the flash without
    reloading the entire page…

  • to MC
    I think we cannot demand anything from Emanuele. Thanks for his work.

    Anyway we will see a lot of terrible clones of Angry Birds after this post i guess :)

  • ela emanuele,
    i was looking for that code

  • LOL

    OMG Adobe Flash shared this tutorial on the Facebook page!!!

  • Awesome job!!!

  • josh

    hey emanuele, can you post a link to download the .fla and .swf thanks

  • Mike

    What is the flash version you need for the .fla? because i tried opening it with macromedia flash 8 and adobe flash cs4..it says unexpected file format

  • Pingback: Starling API – 20 – Lier Starling avec Box2D pour gérer les collisions « Adobe Flex Tutorial()

  • Pingback: Ideas and solution for mini games 2 « Project Management()

  • Philipp

    hy, thank you for the great tutorial!

    where do i find the class files for birdMc, Rock and backgroundMC?
    i have errors because they are undefined.

    thank you!