diff --git a/frontend/public/games/Dodge Square/script.js b/frontend/public/games/Dodge Square/script.js index 51ce4b39..a1d46e74 100644 --- a/frontend/public/games/Dodge Square/script.js +++ b/frontend/public/games/Dodge Square/script.js @@ -90,6 +90,6 @@ document.addEventListener("keydown", e => { document.getElementById("startBtn").addEventListener("click", () => { resetGame(); - setInterval(update, 20); + clearInterval(window.__interval); window.__interval = setInterval(update, 20); draw(); }); diff --git a/frontend/public/games/Flappy Block/script.js b/frontend/public/games/Flappy Block/script.js index af98699f..ff18492c 100644 --- a/frontend/public/games/Flappy Block/script.js +++ b/frontend/public/games/Flappy Block/script.js @@ -54,7 +54,7 @@ function update() { pipes.splice(i, 1); createPipe(); score++; - document.getElementById("score").innerText = `Score: ${score}`; + document.getElementById("score").textContent = `Score: ${score}`; } if (block.x < pipe.x + pipe.width && diff --git a/frontend/public/games/jump-tag/script.js b/frontend/public/games/jump-tag/script.js index c2d520ba..91d8e99f 100644 --- a/frontend/public/games/jump-tag/script.js +++ b/frontend/public/games/jump-tag/script.js @@ -106,7 +106,7 @@ if (player.onGround && player.state === 'alive') { player.vy = -720; player.onGround = false; - if (!muted) audioJump.currentTime = 0, audioJump.play().catch(()=>{}); + if (!muted) audioJump.currentTime = 0, audioJump.play().catch( => console.error()); } }