- Class("TestSystem").inherits(Serpentity.System)({
- prototype : {
- added : function added(engine){
- this.nodeList = engine.getNodes(MovementNode);
- },
- removed : function removed(engine){
- this.nodeList = undefined;
- }
- update : function update(dt){
- this.nodeList.forEach(function (node) {
- console.log("Current position is: " + node.position.x + "," + node.position.y);
- });
- }
+ const TestSystem = class TestSystem extends Serpentity.System {
+ added(engine){
+
+ this.nodeList = engine.getNodes(MovementNode);
+ }
+
+ removed(engine){
+
+ this.nodeList = undefined;
+ }
+
+ update(dt){
+
+ for (const node of this.nodeList) {
+ console.log(`Current position is: ${node.position.x},${node.position.y}`);