for sure... in the following you see the creation of standard floor shapes.
in pStaticActors are all floorshapes be placed.
in another pDynamicActors are all dynamicshapes be placed.
for example rectangle:
Code:
private function createStaticRectangle(tData:Object):void
{
var tStaticShape:Sprite = new Sprite();
tStaticShape.graphics.lineStyle(3, 0xff0000);
tStaticShape.graphics.drawRect(tData.initX,tData.initY, tData.width, tData.height);
var tStatic:b2PolygonDef = new b2PolygonDef();
tStatic.SetAsBox((tStaticShape.width/2)/pPhysScale, (tStaticShape.height/2)/pPhysScale);
tStatic.friction = 0.5;
tStatic.density = 0.0;
tStatic.restitution = 0.1;
var tStaticDef:b2BodyDef = new b2BodyDef();
tStaticDef.position.Set(tData.posX/pPhysScale, tData.posY/pPhysScale);
pObject = {shape:tStaticShape, type:tStatic, bodyDef:tStaticDef};
addStaticShapes(pObject);
}
Code:
private function addStaticShapes(tData:Object):void
{
var tStaticBody:b2Body;
tStaticBody = pWorld.CreateBody(tData.bodyDef);
tStaticBody.CreateShape(tData.type);
tStaticBody.SetMassFromShapes();
pStaticActor = new StaticActor(tStaticBody, tData.shape);
tStaticBody.m_userData = pStaticActor;
pStaticActors.push(pStaticActor);
drawArea.addChild(tData.shape);
}