Commit 821b796

Ansari <ansari_official@yahoo.com>
2024-06-16 10:50:50
bug: Add condition to prevent movement when game is won
1 parent 20a2959
Changed files (1)
004.Maze-Runner
004.Maze-Runner/script.js
@@ -114,6 +114,9 @@ function lightUpButtons(btn){
 }
 
 function movement(maze,movement){
+    if(won){
+        return;
+    }
     const current = document.querySelector(".current");
     const index = Array.from(maze.children).indexOf(current);
     if(movement === "UP" && current.style.borderTop === "none"){