Box2D Basic world setup tutorial

The Box2D physics engine for ActionScript 3 is an extremely powerful tool, but can be a little tricky to figure out at first. So, I have put together an example file showing the basics of the engine. The code in the download is fully commented to help explain what exactly the engine is doing, and how you need to talk to it.

It should make learning the basics a lot easier to handle. In the file you will learn to create a Box2D world, static and dynamic objects, and how to render it all out.

Click here to download

I hope you find it useful.


Comment functionality has been disabled. Contact me on Twitter.

Pablo said:

Cheers Tyler.. You are a champ! This will help me a lot. I know you know a lot about making use of class libraries and it’s good to have someone to ask questions.

Tyler Egeto said:

Look for some more before too much longer. I will be taking a look at joints next.

island said:

It is very useful tutorial, it helps to clear many questions. Test-bed examples, which comes with box2d, are slightly complicated for first meeting. And your source with comments helps to put things on their places. Thanks!

Aaren said:

Your my Hero!!!

mystikum said:

wow, thanks, I couldn’t figure anything out till I read this

Tyler Egeto said:

It could be a number of reasons, I am going to guess that it is a version issue, since Box3D 2.0 came out recently. I have not had any time to look into version 2 yet myself, so I am not sure all what has changed.

Visitor said:

This doesn’t work, even if I have the box2d folder, am I doing something wrong?

Alwyn said:

Hey Tyler, great work! I’ve been doing some basic stuff with box2dflash myself but I can’t seem to get the dragging done. Have any experience with that?

Tyler Egeto said:

Hey, thanks,

No I have not done any interaction stuff, I’ve actually been avoiding Box2D for a little while now, not because I don’t think it’s a great system, but because I think it is missing a couple of key features, for example the ability to resize nodes after creation. Which undoubtedly is tied into the great performance of the system.

Sorry I can’t be of more help.


Browse All >