From 4233b96be24a7304730dfcfda1ba8b0cf5f823d0 Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 4 Apr 2022 12:33:52 -0500 Subject: [PATCH] fix: delegation --- packages/physics/src/resources/decorators/tiles.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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(); }