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.
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)