This commit is contained in:
Maximilian Ruhm 2023-10-23 19:11:26 +02:00
parent 46cb3f22c4
commit eafd6f3d92
3 changed files with 32 additions and 4 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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);