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]);
});
Engine.update(this.engine, currentFrameDuration);
}
-};
+}