added controls to homescreen

This commit is contained in:
sam
2024-01-19 10:07:05 +01:00
parent 4aebb87887
commit a85177efe7
2 changed files with 15 additions and 7 deletions

BIN
web/contols.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

View File

@@ -10,18 +10,15 @@ function keyPressed() {
}
}
function preload() {
controlsImage = loadImage('./contols.png');
}
function homescreen() {
textAlign(CENTER);
button(255, 255, 255, width / 2, height / 2, "Start Game")
button(255, 255, 255, width / 2, height / 2 + height / 12, "Scores")
push()
textSize(50)
fill(255, 255, 255)
text("Highscores", width / 5, height / 4)
text("Controls", width / 5 * 4, height / 4)
pop()
push()
fill(255, 255, 255)
textSize(25)
@@ -38,8 +35,19 @@ function homescreen() {
fill(0, 255, 0, 0)
rect(width / 5, height / 2, width / 4, height / 1.5)
rect(width / 5 * 4, height / 2, width / 4, height / 1.5)
imageMode(CENTER)
image(controlsImage, width / 5 * 4, height / 2, width / 4, height / 1.5)
pop()
push()
textSize(50)
fill(255, 255, 255)
text("Highscores", width / 5, height / 4)
fill(255, 255, 255)
stroke('black');
strokeWeight(4);
text("Controls", width / 5 * 4, height / 4)
pop()
}
function button(r, g, b, buttonX, buttonY, buttonText) {