From f99e16075ab3dd2b46f04246e773702c4e43e9da Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 19 Dec 2023 15:31:22 +0100 Subject: [PATCH] Added ui and text --- web/game.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/web/game.js b/web/game.js index cd0468f..d5c46c5 100644 --- a/web/game.js +++ b/web/game.js @@ -70,7 +70,6 @@ function setup() { createCanvas(width, height); frameRate(framerate); angleMode(DEGREES); - // disable the outline of shapes Movementloop() noStroke(); @@ -472,15 +471,32 @@ function homescreen() { 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") + + push() + stroke(255, 0, 0) + strokeWeight(5) + fill(0, 255, 0, 0) + rect(100, 150, 300, 400) + pop() + + push() + textSize(50) + fill(255, 0, 0) + text("Highscores", 250, 200) + pop() push() stroke(255, 0, 0) strokeWeight(5) fill(0, 255, 0, 0) - rect(100, 150, 300, 400, 20, 20, 20, 20) + rect(860, 150, 300, 400) pop() - + push() + textSize(50) + fill(255, 0, 0) + text("Controls", 1000, 200) + pop() }