All posts about Box2D

Box2D tutorial for the absolute beginners – revamped

About a year ago I published a Box2D tutorial for the absolute beginners. With 2.1 release, a lot of things changed, so it’s time to publish another tutorial for the absolute beginners. In this tutorial we’ll cover needed libraries to import, world creation, debug draw and the creation of static and dynamic boxes and circles. […]

Box2DFlash 2.1a released – what changed

Some days ago Boris the Brave released the new version of the popular physics library. There are some critical changes that won’t make old projects run in the new environment. The most important ones are: It is now not necessary to specify a size for your world, it’ll always be large enough. Improved collisions system […]

Way of an Idea Box2D prototype – Step 3

Welcome to the 3rd part. In part 2 we allowed the player to draw the chalk track in a “paused” Box2D environment and then run the simulation. Now it’s time to delete our chalk track. A bit of theory: although the simulation is paused, the chalk bodies are already placed in the Box2D world. So […]

Shrink it Box2D prototype – Step 2

In the previous step I showed you how to shrink/expand any kind of polygon. Anyway in the original game, you can’t expand objects as much as you want, because you need mass to do it, and this adds strategy to the gameplay, because you have to shrink objects to gather the necessary mass to expand […]

Way of an Idea Box2D prototype – Step 2

It’s time to apply the concepts seen at Pausing a Box2D simulation with Way of an Idea Box2D prototype to create a paused Box2D simulation that will start only when you’ll press SPACE, and meanwhile you can draw paths, just like in the original game. The only problem with this technique is you can’t use […]

Pausing a Box2D simulation

There is a Box2D feature easy to implement and capable to add interesting gameplay that I haven’t found explained anywhere: the pause. I want to stop a Box2D simulation when I click the mouse, and to play it again with another click. The core function of this feature is Step. Normally is called this way: […]

Shrink it Box2D prototype

Finally the Shrink it prototype is ready. This post continues Scaling objects with Box2D and Scaling objects with Box2D – part 2, with these features: 1) You can’t modify static objects 2) You can shrink objects with left mouse button, and expand them with left mouse button + SPACE, as in the original game 3) […]

Way of an Idea Box2D prototype

Did you enjoy Way of an Idea? Nice physics game… besides the joints and motors used in level design, the most interesting part is the chalk drawing. . We are going to do it in three steps Step 1 – Freehand drawing Let’s start with a simple script with some mouse listeners to let the […]

Scaling objects with Box2D – part 2

In the first part I showed you how to scale a circle. Now it’s time to scale a square… but before entering in the tutorial, I would like to do some cut/paste theory :) In Euclidean geometry, uniform scaling or isotropic scaling is a linear transformation that enlarges or increases or diminishes objects; the scale […]

Scaling objects with Box2D

I would like to start talking about a Shrink it prototype but I noticed it’s most based upon objects resizing. So before trying to replicate the game, let’s start with some info about object scaling in Box2D The first interesting thing about Box2D scaling is you can’t scale a Box2D body. And the tutorial is […]