diff --git a/packages/topdown/layer.js b/packages/topdown/layer.js index a5d6bda..e4c2009 100644 --- a/packages/topdown/layer.js +++ b/packages/topdown/layer.js @@ -54,7 +54,6 @@ export class Layer extends decorate(Synchronized) { return false; } const halfTileSize = Vector.scale(tileset.tileSize, 0.5); - const shapeList = new ShapeList() this.tiles.forEachTile((tile, x, y, i) => { const shape = this.tileset.geometry(tile); if (!shape) { @@ -64,12 +63,11 @@ export class Layer extends decorate(Synchronized) { halfTileSize, Vector.mul([x, y], tileset.tileSize), ); - shapeList.addShape(shape); + const body = world.createBody(shape); + body.static = true; + world.addBody(body); + this.tileGeometry.push(body); }); - const body = world.createBody(shapeList); - body.static = true; - world.addBody(body); - this.tileGeometry.push(body); return true; }