From e97eaf5804b3dfc5f2e573668c18739cdafb13d8 Mon Sep 17 00:00:00 2001 From: Mees Roelofsz Date: Wed, 13 Dec 2023 15:40:54 +0100 Subject: [PATCH] added square around selected letter space --- web/game.js | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/web/game.js b/web/game.js index ec00c0e..6eb52bd 100644 --- a/web/game.js +++ b/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;