added square around selected letter space
This commit is contained in:
37
web/game.js
37
web/game.js
@@ -92,9 +92,9 @@ function gameOver() {
|
||||
fill(255, 255, 255)
|
||||
textSize(32);
|
||||
textAlign(CENTER);
|
||||
text(letters[currentIndex[0]], width / 2 - 25, height / 2);
|
||||
text(letters[currentIndex[0]], width / 2 - 30, height / 2);
|
||||
text(letters[currentIndex[1]], width / 2, height / 2);
|
||||
text(letters[currentIndex[2]], width / 2 + 25, height / 2);
|
||||
text(letters[currentIndex[2]], width / 2 + 30, height / 2);
|
||||
pop();
|
||||
|
||||
if (key == ' ') {
|
||||
@@ -161,10 +161,9 @@ async function keyPressed() {
|
||||
nameHS += letters[currentIndex[1]];
|
||||
nameHS += letters[currentIndex[2]];
|
||||
console.log(nameHS);
|
||||
nameHS = '';
|
||||
keyReleasedFlag = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,9 +213,35 @@ function draw() {
|
||||
if (homescreenOn == false) {
|
||||
game();
|
||||
}
|
||||
// keyIsDown();
|
||||
}
|
||||
if (isDead == true) {
|
||||
if (iIndex == 0) {
|
||||
push()
|
||||
stroke(205, 205, 205)
|
||||
strokeWeight(2)
|
||||
fill(0, 0, 0, 0)
|
||||
rect(width / 2 - 45, height / 2 - 30, 30, 40)
|
||||
pop()
|
||||
}
|
||||
if (iIndex == 1) {
|
||||
push()
|
||||
stroke(205, 205, 205)
|
||||
strokeWeight(2)
|
||||
fill(0, 0, 0, 0)
|
||||
rect(width / 2 - 15, height / 2 - 30, 30, 40)
|
||||
pop()
|
||||
}
|
||||
if (iIndex == 2) {
|
||||
push()
|
||||
stroke(205, 205, 205)
|
||||
strokeWeight(2)
|
||||
fill(0, 0, 0, 0)
|
||||
rect(width / 2 + 15, height / 2 - 30, 30, 40)
|
||||
pop()
|
||||
}
|
||||
|
||||
// keyIsDown();
|
||||
}
|
||||
}
|
||||
async function randPatern() {
|
||||
patern = random(paternArray);
|
||||
chosen = true;
|
||||
|
Reference in New Issue
Block a user