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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.