Преглед изворни кода

Move pointer moving into function

ApisNecros пре 2 година
родитељ
комит
4ed0b022f3
1 измењених фајлова са 8 додато и 1 уклоњено
  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);
     }
 
     /**