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/scripts/memory.js b/frontend/public/scripts/memory.js index bb4a7e10..9dc728e8 100644 --- a/frontend/public/scripts/memory.js +++ b/frontend/public/scripts/memory.js @@ -120,7 +120,7 @@ function gameWon() { gameActive = false; // Check for best score - if (!bestScore || moves < parseInt(bestScore)) { + if (!bestScore || moves < parseInt(bestScore, 10)) { bestScore = moves; localStorage.setItem('memoryBestScore', bestScore); document.getElementById('bestScore').textContent = bestScore; diff --git a/frontend/public/scripts/snake.js b/frontend/public/scripts/snake.js index 5dc0b617..16eeef4a 100644 --- a/frontend/public/scripts/snake.js +++ b/frontend/public/scripts/snake.js @@ -56,7 +56,7 @@ function trackVisit() { }, credentials: "include", body: JSON.stringify({ game: "snake" }) - }).catch(() => { }); + }).catch( => console.error()); } function trackPlay() { diff --git a/frontend/public/scripts/whack-a-mole.js b/frontend/public/scripts/whack-a-mole.js index e897de2c..386a81de 100644 --- a/frontend/public/scripts/whack-a-mole.js +++ b/frontend/public/scripts/whack-a-mole.js @@ -47,7 +47,7 @@ function trackVisit() { }, credentials: "include", body: JSON.stringify({ game: "whack-a-mole" }) - }).catch(() => { }); + }).catch( => console.error()); } function trackPlay() {