This native application uses the accelerometer to determine the direction of gravity for the Box2D physics engine. It performs quite well given the number of computations and could probably be optimized considerably. Check out the video for a demo on the phone! Porting the code was the easy part. Configuring Adobe Flash and setting up [...]
Box2D Part 3: Anti-Gravity
posted by Chris Black on August 17th, 2009 under ActionScript
Can you get the objects to float in space using your mouse? This is the conclusion to the three part series on using the Box2D Physics engine with ActionScript. Box2D Anti-Gravity Example: var flashvars = {}; var params = { bgcolor: "ffffff" }; swfobject.embedSWF("http://www.blackcj.com/blog/wp-content/swfs/Box2DQuickStart/Box2DQuickStart.swf", "Box2DQuickStart", "440", "340", "9.0.0", "flash/expressInstall.swf", flashvars, params); Box2D Anti-Gravity Example (click [...]
Box2d Part 2: Shape Factory
posted by Chris Black on August 17th, 2009 under ActionScript
Now that we have created our small world using the Box2D physic engine let's start creating shapes! The shape factory will allow you to define any shapes you would like to add to your world. In this example we will create polygons. Polygons in this example will be defined as a shape with 3 or [...]
Box2D Part 1: It’s a Small World
posted by Chris Black on August 17th, 2009 under ActionScript
The Box2d Physics Engine for ActionScript from the Ground Up We'll start with the basic 2d environment (part 1) and work our way into creating dynamic polygons (part 2) with an anti-gravity effect (part 3). Here's a preview of what we will end up with: // Google Maps Text Event (click and hold the mouse [...]









