Game Development Reference
In-Depth Information
Forces in a real game
Now, let's apply forces to a real world example, Angry Birds.
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);
brick(544,431,140,36);
brick(342,396,16,32);
brick(604,396,16,32);
brick(416,347,16,130);
brick(532,347,16,130);
brick(474,273,132,16);
brick(474,257,32,16);
 
Search WWH ::




Custom Search