All posts about Box2D

Drawing boxes on the fly in Box2D

Box2D is getting more and more popular among Flash developers, but it still lacks of adeguate tutorials and documentation about making games with it. Andrew McGrath from Gamersgarden released a great tutorial about drawing boxes on the fly on Box2D. Every detail of the script is fully commented, so you won’t miss anything, and you […]

Box2D joints: Distance Joint

One of the most interesting Box2D features are joints. Joints are used to constraint two bodies together in various ways and allow you to create very complex objects such as ragdolls and motors. At the moment, Box2D features six different joint types: Distance, Gear, Mouse, Prismatic, Pulley and Revolute joint. In this post, we’ll learn […]

Understanding how Box2D manages collisions

Box2D is a great library because you don’t have to care for collisions, the library manages all by itself. But sometimes, specially in games, you may need to know when the player hits the coin, or the enemy, or whatever. Box2D has a class called b2ContactListener that you have to rewrite to make it work […]

Understanding custom polygons in Box2D

Last week I explained The magic of compound objects with Box2D, now it’s time to understanding custom polygons. First, let me tell you the difference between a compound object and a custom polygon. A compound object is an object made by two or more primitive objects (like the maze I created in this tutorial). A […]

The magic of compound objects with Box2D

You can call it complex shapes, compound shapes, complex objects, compound objects or even poisoned underpants, but you all want to create complex “things” with Box2D. Despite the “complex” word, it’s very easy to create one. You just have to add multiple shapes to a body. If you followed my latest Box2D tutorials, you will […]

Understanding Box2D debug draw

When you are about to create a complex script with Box2D – or even a simple one, but that’s complex for your skills – I suggest to enable debug draw. Debug draw will provide you everything you need in order to verify your script is working correctly, and once you are satisfied with the result, […]

Dragging objects with Box2D Flash

This is ideally the next part after Understanding pixels and meters with Box2D and how to select an object with mouse – part 2, but it’s so important understanding how to drag objects with Box2D that I decided to change the title. Anyway, in this uncommented example (a commented one will follow) you can select […]

The engine behind Splitter Flash game

If you played Splitter in these days, you probably enjoyed the gameplay thanks to the knife cutting and slicing various objects in the game Obviously you can made your own splitter game with BOX2D, and the “only” problem seems to be the knife. Well, in the BOX2D official forum there is a thread where a […]