diff --git a/index.html b/index.html index 54484c2..214b0bf 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,7 @@

Score:

Lives:

+

Speed:

KyFlo Snake

diff --git a/sources/js/index.js b/sources/js/index.js index 3e156d9..350c397 100644 --- a/sources/js/index.js +++ b/sources/js/index.js @@ -9,6 +9,7 @@ const lives = document.getElementById("lives"); const gameOver = document.getElementById("gameovermodal"); const scoreBoard = document.getElementById("scoreboard"); const playerName = document.querySelector("input"); +const speed = document.getElementById("speed"); const audio = new Audio("sources/sound/main.mp3"); const startSound = new Audio("sources/sound/onStart.mp3"); const eatSound = new Audio("sources/sound/onEat.mp3"); @@ -107,6 +108,7 @@ function loadGame(data) { function updateScore(s) { score.innerText = `Score: ${s}`; + speed.innerText = `Speed: ${game.snakeSpeed} ms`; } function updateLives(l) {