added button to score + changed buttons

This commit is contained in:
Mees Roelofsz
2024-01-19 12:31:15 +01:00
parent 613829164c
commit aa4da98839

View File

@@ -1,6 +1,5 @@
let buttonSelectScore = 0; let buttonSelectScore = 0;
let searchName = ''; let searchName = '';
let scorescreenOn = false;
let dataIsCalled = false; let dataIsCalled = false;
let clearDataOnce = false; let clearDataOnce = false;
function keyPressed() { function keyPressed() {
@@ -56,7 +55,7 @@ function homescreen() {
function button(r, g, b, buttonX, buttonY, buttonText) { function button(r, g, b, buttonX, buttonY, buttonText) {
push() push()
fill(0, 0, 50) noFill()
rectMode(CENTER); rectMode(CENTER);
rect(buttonX, buttonY, buttonWidth, buttonHeight) rect(buttonX, buttonY, buttonWidth, buttonHeight)
textSize(25) textSize(25)
@@ -133,14 +132,18 @@ function scoremenu() {
strokeWeight(5) strokeWeight(5)
fill(0, 255, 0, 0) fill(0, 255, 0, 0)
//box left //box left
rect(width / 4 * 3, height / 2, width / 3, height / 1.25) rect(width / 4 * 3, height / 2, width / 3.5, height / 1.25)
//box right //box right
rect(width / 4, height / 2, width / 3, height / 1.25) rect(width / 4, height / 2, width / 3.5, height / 1.25)
pop() pop()
push() push()
text("Your scores", width / 4, height / 6) text("Your scores", width / 4, height / 6)
text("Your achievements", width / 4 * 3, height / 6) text("Your achievements", width / 4 * 3, height / 6)
pop() pop()
push()
button(255, 255, 255, width / 2, height / 2, "Main Menu")
pop()
} }
function gameOver() { function gameOver() {