Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/public/games/Fruit Slice/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
2 changes: 1 addition & 1 deletion frontend/public/games/flappyBird/flappy.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bottomPipeImg= new Image();
bottomPipeImg.src="bottompipe.png";

requestAnimationFrame(update);
setInterval(placePipes, 1500); //1.5 sec
clearInterval(window.__interval); window.__interval = setInterval(placePipes, 1500); //1.5 sec
document.addEventListener("keydown",moveBird);
};
context.drawImage(birdImg, bird.x, bird.y, bird.width, bird.height);
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/scripts/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/scripts/rps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const choices = {
scissors: { emoji: "✂️", name: "Scissors" },
};

let scores = JSON.parse(localStorage.getItem("rpsScores")) || {
let scores = (JSON.parse(localStorage.getItem("rpsScores") ?? "null") ?? null) || {
player: 0,
computer: 0,
draws: 0,
Expand Down