Quellcode durchsuchen

Move pointer moving into function

ApisNecros vor 2 Jahren
Ursprung
Commit
4ed0b022f3
1 geänderte Dateien mit 8 neuen und 1 gelöschten Zeilen
  1. 8 1
      starfish.js

+ 8 - 1
starfish.js

@@ -136,7 +136,14 @@ class CodeBox {
             }
         }
 
-        this.SetPointer(this.curr_direction[0], this.curr_direction[1]);
+        this.Move();
+    }
+
+    Move() {
+        const newX = this.pointer[0] + this.curr_direction[0];
+        const newY = this.pointer[1] + this.curr_direction[1];
+
+        this.SetPointer(newX, newY);
     }
 
     /**