-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);
- });
+ import { System } from '@serpentity/serpentity';
+ const TestSystem = class TestSystem extends 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}`);