我有以下代码,它将图像放到1个随机体中。
for (var b:b2Body=world.GetBodyList(); b; b=b.GetNext()) {
for (var i:int=0; i<3; i++) {
var distX:Number = b.GetPosition().x * worldScale - (220 + i * 100);
var distY:Number = b.GetPosition().y * worldScale - 180;
if (b.GetType()==b2Body.b2_dynamicBody) {
myBlock.x = distX + (220 + i * 100);
myBlock.y = distY + 180;
myBlock.rotation = b.GetAngle() * 180 / Math.PI;
//world.DestroyBody(b);
//createBox(220 + i * 100,180,b2Body.b2_staticBody);
}
}
}
我希望能够将多个图像添加到多个实体中。我怎么能这样做?