소스 검색

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);
     }
 
     /**