diff --git a/packages/physics/src/resources/decorators/tiles.js b/packages/physics/src/resources/decorators/tiles.js index 46b0152..d79c0c5 100644 --- a/packages/physics/src/resources/decorators/tiles.js +++ b/packages/physics/src/resources/decorators/tiles.js @@ -12,11 +12,6 @@ export default (Tiles) => class PhysicsTiles extends Tiles { $$world; - constructor() { - super(); - this.on('update', this.onTilesUpdate, this); - } - addBodies() { if (!this.$$world) { return; @@ -41,7 +36,8 @@ export default (Tiles) => class PhysicsTiles extends Tiles { this.$$impassable = new Set(impassable); } - onTilesUpdate() { + onTilesUpdate(rectangle) { + super.onTilesUpdate(rectangle); this.removeBodies(); this.addBodies(); }