diff --git a/frontend/public/games/Balloon Popper/script.js b/frontend/public/games/Balloon Popper/script.js index 7c12451f..7c5d7c75 100644 --- a/frontend/public/games/Balloon Popper/script.js +++ b/frontend/public/games/Balloon Popper/script.js @@ -96,6 +96,6 @@ function resetGame() { document.getElementById("restart-btn").addEventListener("click", resetGame); // Balloon spawner -setInterval(spawnBalloon, 800); +clearInterval(window.__interval); window.__interval = setInterval(spawnBalloon, 800); update(); diff --git a/frontend/public/games/Fruit Slice/script.js b/frontend/public/games/Fruit Slice/script.js index d78c0ce6..4b8a6d3d 100644 --- a/frontend/public/games/Fruit Slice/script.js +++ b/frontend/public/games/Fruit Slice/script.js @@ -98,6 +98,6 @@ canvas.addEventListener("mousemove", (e) => { document.getElementById("restart-btn").addEventListener("click", resetGame); // Spawn fruits continuously -setInterval(spawnFruit, 900); +clearInterval(window.__interval); window.__interval = setInterval(spawnFruit, 900); update(); diff --git a/frontend/public/games/color grid/script.js b/frontend/public/games/color grid/script.js index b9e04678..b67111d1 100644 --- a/frontend/public/games/color grid/script.js +++ b/frontend/public/games/color grid/script.js @@ -195,7 +195,7 @@ function checkWin(){ if(isSolved()){ // update best if necessary const key = bestKey(SIZE); - const prevBest = parseInt(localStorage.getItem(key) || '0',10) || 0; + const prevBest = parseInt(localStorage.getItem(key, 10) || '0',10) || 0; if(prevBest===0 || moves < prevBest){ localStorage.setItem(key, moves); bestEl.textContent = moves; diff --git a/frontend/public/scripts/minesweeper.js b/frontend/public/scripts/minesweeper.js index a87f3deb..de3b9236 100644 --- a/frontend/public/scripts/minesweeper.js +++ b/frontend/public/scripts/minesweeper.js @@ -329,7 +329,7 @@ class Minesweeper { // Restore board content document.querySelectorAll('.cell').forEach(cell => { cell.style.background = cell.style.originalBackground || ''; - const row = parseInt(cell.dataset.row); + const row = parseInt(cell.dataset.row, 10); const col = parseInt(cell.dataset.col); this.updateCellDisplay(row, col); });