added score
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user