From eafd6f3d9268ad674b52440dfb83bde987c0f775 Mon Sep 17 00:00:00 2001 From: Maximilian Ruhm Date: Mon, 23 Oct 2023 19:11:26 +0200 Subject: [PATCH] finish --- game/keys.pde | 9 +++++++++ game/main.pde | 16 ++++++++++++++++ game/map.pde | 11 +++++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/game/keys.pde b/game/keys.pde index a721c14..573b520 100644 --- a/game/keys.pde +++ b/game/keys.pde @@ -2,8 +2,17 @@ boolean iseditorModeRect = true; boolean iseditorModeSpike = false; +float volume = 0.2; void keyPressed () { + if (key == 'm') { + if (volume == 0.2) { + volume = 0; + } else { + volume = 0.2; + } + gamesoundtrack.amp(volume); + } if (ismenu) { } else if (isgame) { if (key == CODED) { diff --git a/game/main.pde b/game/main.pde index d0cec12..0001d5b 100644 --- a/game/main.pde +++ b/game/main.pde @@ -73,7 +73,14 @@ void mainMenu() { } fill(0); textSize(40); + textAlign(CENTER); text("Exit", 50, 110); + + // Text in corner + textAlign(LEFT); + fill(0); + textSize(20); + text("m - mute audio", 10, 700); } void menuButton() { @@ -90,6 +97,7 @@ void menuButton() { } fill(0); textSize(40); + textAlign(CENTER); text("Exit", 50, 50+10); } @@ -100,6 +108,14 @@ void mapEditor() { generate_editor_tiles(); // generate_tiles(); menuButton(); + + // Texts at Top + textAlign(RIGHT); + textSize(20); + text("SPACE - Toggle between rect and triangle", 790, 50); + text("Left Click - Place block", 790, 70); + text("Right Click - Delete Block", 790, 90); + text("Arrows - Move right and left", 790, 110); } // Rectangle with editor colission diff --git a/game/map.pde b/game/map.pde index d9eceec..c9170a7 100644 --- a/game/map.pde +++ b/game/map.pde @@ -63,6 +63,7 @@ void drawBackground() { color sky = color(94, 218, 252); color sand = color(235, 218, 174); color darksand = color(232, 177, 120); + color darkersand = color(166, 110, 51); color sea = color(51, 169, 255); color seaend = color(146, 254, 255); color sun = color(247, 178, 2); @@ -93,9 +94,12 @@ void drawBackground() { drawPalm(300, 700); drawPalm(400, 700); - fill(darksand); - point(500, 770); - + fill(0, 200); + stroke(darkersand); + for (int i = 0; i < 500; i++) { + point(random(0, width), random(700, 800)); + } + stroke(0); fill(0); } @@ -112,7 +116,6 @@ void drawPalm(int startingpoint_x, int startingpoint_y) { int offset = 8; PVector endpoint = new PVector(startingpoint_x, startingpoint_y - randomnumber * offset); for (int i = 0; i <= randomnumber; i++) { - triangle(endpoint.x+i*schwanken, endpoint.y+i*offset, endpoint.x+10+i*schwanken, endpoint.y+10+i*offset, endpoint.x+20+i*schwanken, endpoint.y+i*offset); } fill(93, 133, 47);