Review of Box2D for Flash Games (Author: Emanuele Feronato)

In Example 6.1, we explore joints in box2d, creating a mouse joint to be able to pickup, and interact with objects, a distance joint,
to maintain the same distance between two bodies, and a revolute joint, allowing a body to freely revolve around a point.

(Click on boxes to move/ interact with them)


Download the source Code and please leave me any comments or feedback you have.

In Example 6.2 we build upon the basics we learned about joints, and actually create a “crush the castle” like siege machine.
First we create a set of car, or cart like object that we can control with the keyboard. Next we learn about one way of handling collision filtering, to create a catapult like device that has the projectile pass through the cart objects without collision.
Finally, we use another way of collision filtering, to allow the projectile to pass through just the cart arm, but nothing else in our level, and add a basic angry birds level, which we can destroy.

(use ‘Up’ to release projectile, ‘Left’ and ‘Right’ to move the cart)


Download the source Code and please leave me any comments or feedback you have.

Leave a Comment

Scroll to Top