This commit is contained in:
Maximilian Ruhm 2023-10-21 13:06:37 +02:00
parent 92a6ace93b
commit 0db9e72d8d

View File

@ -2,6 +2,7 @@ int screenx = 0;
// level generation
void generate_tiles() {
stroke(0);
for (int i = 0; i < level.length; i++ ) {
rect(level[i][0]-screenx, level[i][1], level[i][2], level[i][3]);
}
@ -35,25 +36,29 @@ void drawBackground() {
color darksand = color(232, 177, 120);
color sea = color(51, 169, 255);
color seaend = color(146, 254, 255);
color sun = color(247, 178, 2);
// sky
background(sky);
// sea
// for(int y = 400; y < 650; y++){
// float inter = map(y, 400, 650, 0, 1);
// color c = lerpColor(sea, seaend, inter);
// stroke(c);
// line(0, y, width, y);
// noStroke();
// }
fill(sea);
quad(0, 400, width, 400, width, 650, 0, 650);
for(int y = 400; y < 650; y++){
float inter = map(y, 400, 650, 0, 1);
color c = lerpColor(sea, seaend, inter);
stroke(c);
line(0, y, width, y);
noStroke();
}
// Beach
fill(sand);
quad(0, 650, width, 650, width, height, 0, height);
// Player stands on this
fill(darksand);
quad(0, 0.850*height, width, 0.850*height, width, height, 0, height);
//sun
fill(sun);
ellipse(130, 100, 70, 70);
fill(0);
}