diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-07-11 22:42:38 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-07-11 22:42:38 +0200 |
| commit | aaa1f8f65bae59680e930fa6788e4662abae332c (patch) | |
| tree | 2d5f693225d9ee725db79327766a5f80b9949237 /lib/systems/physics_world_control.js | |
| parent | 7741a3cc37662ab2ff9606bdaffc0317b79a8dd9 (diff) | |
Update dependenciesrbdr-bouncy-walls
Diffstat (limited to 'lib/systems/physics_world_control.js')
| -rw-r--r-- | lib/systems/physics_world_control.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/systems/physics_world_control.js b/lib/systems/physics_world_control.js index 88c60e4..4ba4ec1 100644 --- a/lib/systems/physics_world_control.js +++ b/lib/systems/physics_world_control.js @@ -59,20 +59,20 @@ export default class PhysicsWorldControlSystem extends System { this.physicalEntities = engine.getNodes(PhysicalNode); this.grabAreaEntities = engine.getNodes(GrabAreaNode); - this.physicalEntities.on('nodeAdded', (event) => { + this.physicalEntities.addEventListener('nodeAdded', (event) => { World.add(this.engine.world, [event.node.body.body]); }); - this.physicalEntities.on('nodeRemoved', (event) => { + this.physicalEntities.addEventListener('nodeRemoved', (event) => { World.remove(this.engine.world, [event.node.body.body]); }); - this.grabAreaEntities.on('nodeAdded', (event) => { + this.grabAreaEntities.addEventListener('nodeAdded', (event) => { World.add(this.engine.world, [event.node.grabArea.area]); }); - this.grabAreaEntities.on('nodeRemoved', (event) => { + this.grabAreaEntities.addEventListener('nodeRemoved', (event) => { World.remove(this.engine.world, [event.node.grabArea.area]); }); |