Thursday, September 10, 2009

simple box2D tutorial

After showing John my latest as-hive integration, he commented that it looked "pretty clunky" and I have to agree. For some reason, the game and physics tests are running very slowly which probably means HIVE is sapping resources somewhere; probably because I was using an old version.



Today, I did another quick tech demo and this time I picked the latest as-hive version 3 which uses the new swc to allow me to work completely in FlexBuilder 3. I should also look at in the Flex Profiler and possibly add some other opensource AS3 memory diagnostic views to make sure version 3 is tight.

This is the second time that I've been inspired by one of Emanuele's great demos, and this time I rewrote it to work more like lego blocks -- IMHO more digestable bites -- and also gave the variables clear English names like "groundBody" or "meteorBallBody".

as-hive and box2d demo

code sample:

public function PhysicsWorld():void
{
createWorld();

drawDebug();
drawGround();
drawBuilding();
drawMeteor();

addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}

full source

I added some comments throughout the code. For instance, if you change the density of the meteor from 100 to 10 it will land peacefully on the roof like a zeppelin but that's another game.

For time to time, we'll try to post small samples like this. Now, onto to skinning the objects and playing with setPixel32 to rip into them.

Wednesday, September 9, 2009

team dev

So far the coding department of DD has been comprised of one John Stringham, and he's made some awesome solo progress. But now I'd like to join the fray a bit and work on some of the screens around the gameplay -- perhaps collaborate with John on an episode.

I've reached a small milestone today by integrating HIVE with DD so I can work around John's efforts.

The following are two tech demos mainly for John's benefit to show him what I've been working on:

build 1 <--- plugs in an old version of John's demo
build 2 <--- borrows Emanuele Feronato's nice box2D demo

One episode can now be easily be swapped out for a different one.

By using this type of framework, we can continue to work independently even take on different episodes while we create hooks between the screens and maintain the flow.