Forces in a real game

Now, let's apply forces to a real world example, Angry Birds.

Forces in a real game

Angry Birds: Rovio Entertainment Ltd. (www.rovio.com)

This is the first level of the Chrome version, and that's what we are going to build.

At this stage, building an Angry Birds level is not that different from building a Totem Destroyer level. As you can see, I have recycled most of the functions explained in previous chapters. So, the following is how the Main class looks now:

public class Main extends Sprite { private var world:b2World; private var worldScale:Number=30; public function Main() { world=new b2World(new b2Vec2(0,5),true); debugDraw(); floor(); brick(402,431,140,36); ...

Get Box2D for Flash Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.