Looping through bodies and getting their properties

The next example will build some kind of information display that monitors the idol. At every frame, we'll read the idol position, rotation, and speed. This way, you can assign events according to idol properties, such as giving a bonus if the idol did not fall down, or if it never reached a certain y-speed, or if it moved too far on the left, and so on. Knowing body properties is also very useful when you want to skin your game, as you can synchronize custom graphic assets to what happens in the Box2D World.

One step at time, let's start with our idol monitor. We are going to display idol data in a dynamic text field, so we need to make some basic changes to our class. I won't explain such changes ...

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.