diff --git a/web/game.js b/web/game.js index ceedf81..ec00c0e 100644 --- a/web/game.js +++ b/web/game.js @@ -91,10 +91,10 @@ function gameOver() { push(); fill(255, 255, 255) textSize(32); + textAlign(CENTER); text(letters[currentIndex[0]], width / 2 - 25, height / 2); text(letters[currentIndex[1]], width / 2, height / 2); text(letters[currentIndex[2]], width / 2 + 25, height / 2); - text(iIndex, width / 2 + 50, height / 2); pop(); if (key == ' ') { @@ -418,24 +418,7 @@ function spawnRandomBullet() { function homescreen() { - // push() - // fill(0, 0, 0, 200) - // square(0, 0, 1600) - // pop() - - // push() - // fill(255, 0, 0) - // let buttonHeight = height/2 - // rect(width/2-90, buttonHeight, 200, 40 , 20, 20, 20, 20) - // textSize(25) - // fill(0,0,0) - // text("Start Game", width/2+10, buttonHeight+30) - // if (mouseX > width/2-90 && mouseX < width/2+110 && mouseY > height/2 && mouseY < buttonHeight+40) { - // if (mouseIsPressed) { - // homescreenOn = false; - // } - // } - // pop() + textAlign(CENTER); button(0, 0, 0, width / 2 - 90, height / 2, 200, 40, "Start Game") button(0, 0, 0, width / 2 - 90, height / 2 + 50, 200, 40, "Scores")