experimenting with colors + changed main menu to change based on size

This commit is contained in:
Mees Roelofsz
2024-01-16 10:21:52 +01:00
parent eb188ee83b
commit 9eb06d9f6f
2 changed files with 19 additions and 17 deletions

View File

@@ -17,46 +17,46 @@ function keyPressed() {
function homescreen() {
textAlign(CENTER);
button(255, 255, 255, width / 2, height / 2, 200, 40, "Start Game")
button(255, 255, 255, width / 2, height / 2 + 50, 200, 40, "Scores")
button(255, 255, 255, width / 2, height / 2, "Start Game")
button(255, 255, 255, width / 2, height / 2 + height/12, "Scores")
push()
stroke(255, 255, 255)
stroke(4,217,255)
strokeWeight(5)
fill(0, 255, 0, 0)
rect(width/4*3, height/2, 300, 400)
rect(width/5*4, height/2, width/4, height/1.5)
pop()
//highscores rectangle
push()
textSize(50)
fill(255, 255, 255)
text("Highscores", width/4, 200)
text("Highscores", width/5, height/4)
pop()
push()
fill(255, 255, 255)
textSize(25)
textAlign(CENTER)
textAlign(CENTER, CENTER)
for (let i = 0; i < requesteddata.length; i++) {
text(i + 1 + ". " + requesteddata[i].Naam + ": " + requesteddata[i].Score, width/4, 250 + (i * 30))
text(i + 1 + ". " + requesteddata[i].Naam + ": " + requesteddata[i].Score, width/5, height/3 + (i * 30))
}
pop()
push()
stroke(255, 255, 255)
stroke(4,217,255)
strokeWeight(5)
fill(0, 255, 0, 0)
rect(width/4, height/2, 300, 400)
rect(width/5, height/2, width/4, height/1.5)
pop()
push()
textSize(50)
fill(255, 255, 255)
text("Controls", width/4*3, 200)
text("Controls", width/5*4, height/4)
pop()
}
function button(r, g, b, buttonX, buttonY, buttonWidth, buttonHeight, buttonText) {
function button(r, g, b, buttonX, buttonY, buttonText) {
push()
fill(0, 0, 50)
rectMode(CENTER);
@@ -74,6 +74,6 @@ function pauseMenu(){
textSize(50);
fill(255, 255, 255);
text("Paused", width / 2, height / 2 - 100);
button(255, 255, 255, width / 2, height / 2, 200, 40, "Resume");
button(255, 255, 255, width / 2, height / 2 + 50, 200, 40, "Main Menu");
button(255, 255, 255, width / 2, height / 2, "Resume");
button(255, 255, 255, width / 2, height / 2 + height/12, "Main Menu");
}