Browse Source

Move pointer moving into function

ApisNecros 2 years ago
parent
commit
4ed0b022f3
1 changed files with 8 additions and 1 deletions
  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);
     }
 
     /**