diff --git a/web/game.js b/web/game.js index fbd1530..ab09fc0 100644 --- a/web/game.js +++ b/web/game.js @@ -95,8 +95,11 @@ function gameOver() { text("Game Over", width / 2, height / 2 - 80); fill(255, 255, 255) - textSize(32); + textSize(18); textAlign(CENTER); + text("Score: " + int(time), width / 2, height / 2 - 55); + + textSize(32); text(letters[currentIndex[0]], width / 2 - 30, height / 2); text(letters[currentIndex[1]], width / 2, height / 2); text(letters[currentIndex[2]], width / 2 + 30, height / 2); @@ -185,6 +188,7 @@ async function keyPressed() { finalPhase = false; isDead = false; entered = false; + buttonSelect = 0; } } if (buttonSelect == 2) { @@ -204,6 +208,7 @@ async function keyPressed() { finalPhase = false; isDead = false; entered = false; + buttonSelect = 0; } } } @@ -245,7 +250,6 @@ async function Movementloop() { function draw() { keyPressed(); gameOver(); - phase(); // draw background background(0, 0, 0, 100); @@ -253,6 +257,7 @@ function draw() { homescreen(); } if (homescreenOn == false) { + phase(); game(); } if (isDead == true) {