added score
This commit is contained in:
@@ -95,8 +95,11 @@ function gameOver() {
|
|||||||
text("Game Over", width / 2, height / 2 - 80);
|
text("Game Over", width / 2, height / 2 - 80);
|
||||||
|
|
||||||
fill(255, 255, 255)
|
fill(255, 255, 255)
|
||||||
textSize(32);
|
textSize(18);
|
||||||
textAlign(CENTER);
|
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[0]], width / 2 - 30, height / 2);
|
||||||
text(letters[currentIndex[1]], width / 2, height / 2);
|
text(letters[currentIndex[1]], width / 2, height / 2);
|
||||||
text(letters[currentIndex[2]], width / 2 + 30, height / 2);
|
text(letters[currentIndex[2]], width / 2 + 30, height / 2);
|
||||||
@@ -185,6 +188,7 @@ async function keyPressed() {
|
|||||||
finalPhase = false;
|
finalPhase = false;
|
||||||
isDead = false;
|
isDead = false;
|
||||||
entered = false;
|
entered = false;
|
||||||
|
buttonSelect = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (buttonSelect == 2) {
|
if (buttonSelect == 2) {
|
||||||
@@ -204,6 +208,7 @@ async function keyPressed() {
|
|||||||
finalPhase = false;
|
finalPhase = false;
|
||||||
isDead = false;
|
isDead = false;
|
||||||
entered = false;
|
entered = false;
|
||||||
|
buttonSelect = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,7 +250,6 @@ async function Movementloop() {
|
|||||||
function draw() {
|
function draw() {
|
||||||
keyPressed();
|
keyPressed();
|
||||||
gameOver();
|
gameOver();
|
||||||
phase();
|
|
||||||
// draw background
|
// draw background
|
||||||
background(0, 0, 0, 100);
|
background(0, 0, 0, 100);
|
||||||
|
|
||||||
@@ -253,6 +257,7 @@ function draw() {
|
|||||||
homescreen();
|
homescreen();
|
||||||
}
|
}
|
||||||
if (homescreenOn == false) {
|
if (homescreenOn == false) {
|
||||||
|
phase();
|
||||||
game();
|
game();
|
||||||
}
|
}
|
||||||
if (isDead == true) {
|
if (isDead == true) {
|
||||||
|
Reference in New Issue
Block a user