All posts about Box2D

Box2D joints: Revolute Joint – Building motors

After seeing how to create a revolute joint, it’s time to use them to create motors. Box2D already has everything we need to create such motors. The script is the same as the one I showed you in Box2D joints: Revolute Joint, and you just need to add the lines I am going to show […]

Box2D joints: Revolute Joint

After introducing Distance Joints, it’s time to learn something about Revolute Joints. A Revolute Joint attaches two objects by “pinning” them together at an anchor point which they may revolve around. The most interesting thing, that I will cover in another post, is the capibility of making motors out of Revolute Joints. Yes… motors… engines… […]

SamePhysics – My first Box2D game

You are all invited to play SamePhysics, my first Box2D game. It’s a small milestone because it’s my first Box2D game. The game is the remake of SameGame, just using Box2D to manage the blocks. It’s not the greatest game of the year, but developing a full Box2D game made me acquire the experience to […]

Phyballs: when Arkanoid meets Box2D – Full source code

Box2D is getting more and more popular among developers, and I am proud to have the permission to publish the first source code for a complete Box2D game. The author is Esteban Gallardo, author of Free Creation Games. The game is called Phyballs And this is the source code. I have to say, this is […]

Drawing circles on the fly in Box2D

Only a day after Drawing boxes on the fly in Box2D I got three submissions for drawing circles on the fly. I will list all of them, and I found interesting how different Flashers obtained the same result in quite the same way. The first to send the routine was Vitaliy Berov: This is the […]

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 […]