X-Git-Url: https://git.r.bdr.sh/rbdr/sumo/blobdiff_plain/1676911c8a2621274bf75ff7271faa926cf58d6c..refs/heads/rbdr-bouncy-walls:/lib/systems/physics_world_control.js diff --git a/lib/systems/physics_world_control.js b/lib/systems/physics_world_control.js index 370701e..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]); }); @@ -109,5 +109,5 @@ export default class PhysicsWorldControlSystem extends System { Engine.update(this.engine, currentFrameDuration); } -}; +}