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()); } } diff --git a/frontend/public/scripts/simon.js b/frontend/public/scripts/simon.js index 7afed7fc..85df0fe7 100644 --- a/frontend/public/scripts/simon.js +++ b/frontend/public/scripts/simon.js @@ -2,7 +2,7 @@ let sequence = []; let playerSequence = []; let level = 1; -let highScore = parseInt(localStorage.getItem('simonHighScore')) || 0; +let highScore = parseInt(localStorage.getItem('simonHighScore', 10)) || 0; let gameActive = false; let showingSequence = false; let inputLocked = false; diff --git a/frontend/public/scripts/sudoku.js b/frontend/public/scripts/sudoku.js index 72c98737..815de8fd 100644 --- a/frontend/public/scripts/sudoku.js +++ b/frontend/public/scripts/sudoku.js @@ -104,7 +104,7 @@ function handleKeyPress(e) { const key = e.key; if (key >= '1' && key <= '9') { - inputNumber(parseInt(key)); + inputNumber(parseInt(key, 10)); } else if (key === 'Delete' || key === 'Backspace') { clearCell(); } diff --git a/frontend/public/scripts/tic-tac-toe.js b/frontend/public/scripts/tic-tac-toe.js index be2c8d51..c17e0570 100644 --- a/frontend/public/scripts/tic-tac-toe.js +++ b/frontend/public/scripts/tic-tac-toe.js @@ -17,7 +17,7 @@ function saveScore(score) { let board = ['', '', '', '', '', '', '', '', '']; let currentPlayer = 'X'; let gameActive = true; -let scores = JSON.parse(localStorage.getItem('ticTacToeScores')) || { x: 0, o: 0, draws: 0 }; +let scores = (JSON.parse(localStorage.getItem('ticTacToeScores') ?? "null") ?? null) || { x: 0, o: 0, draws: 0 }; // Winning combinations const winningConditions = [