fix: delegation

This commit is contained in:
cha0s 2022-04-04 12:33:52 -05:00
parent 229028821c
commit 4233b96be2

View File

@ -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();
}