This commit is contained in:
2025-10-03 00:06:50 +02:00
2 changed files with 2 additions and 2 deletions

View File

@@ -11,7 +11,7 @@
<div id="game-container"> <div id="game-container">
<canvas id="gameCanvas" width="400" height="400"></canvas> <canvas id="gameCanvas" width="400" height="400"></canvas>
</div> </div>
<div id="score">Puntaje: <span id="score-value">0</span></div> <div id="score">Puntuación: <span id="score-value">0</span></div>
<button id="restart-btn">Reiniciar</button> <button id="restart-btn">Reiniciar</button>
<div id="game-over-message"></div> <div id="game-over-message"></div>
<script src="script.js"></script> <script src="script.js"></script>

View File

@@ -106,7 +106,7 @@ function changeDirection(e) {
function endGame() { function endGame() {
clearInterval(gameInterval); clearInterval(gameInterval);
gameOver = true; gameOver = true;
gameOverDiv.textContent = "¡Fin del juego! Puntaje final: " + score; gameOverDiv.textContent = "¡Fin del juego! Puntuación final: " + score;
} }
window.addEventListener('keydown', changeDirection); window.addEventListener('keydown', changeDirection);