Or this, sometimes it reminds me about kindergarde 🙂
Have a good time…
//Landschaft, Häuser und Dinger.
float xposition = 0;
int yposition;
int bg ;
int moveX= 6;
void setup () {
size(600,400);
background(255);
frameRate(45);
smooth();
}
void draw () {
int rsonne = 150;
int rboden = 200;
int size = 10;
moveX++;
background(130,130,130);
fill (255,255,0);
ellipse(width-rsonne,height/6,rsonne,rsonne); // Sonne //width/2-50 wäre hier die Mitte, eventuell checken
clouds (0, 45); // Wolke 1 mit x und y position
clouds (245, 90); // Wolke 2 mit x und y position
clouds (90, 135); // Wolke 3 mit x und y position
clouds (0, 180); // Wolke 4 mit x und y position
// damit sie vor der Sonne bleiben
//house(width/2-50,height-rboden,10*size,color(random(255),random(255),random(255)), color(123,213)); //Mittleres
house(width/2-50,height-rboden,10*size,color(200), color(123,213));
//house(width/2-250,height-rboden+25,10*size,color(random(255),random(255),random(255)), color(123,213)); //linkes Haus
house(width/2-250,height-rboden+25,10*size,color(200,0,40), color(123,213)); //linkes Haus
//house(width/2+150,height-rboden+25,10*size,color(random(255),random(255),random(255)), color(123,213)); // rechtes Haus
house(width/2+150,height-rboden+25,10*size,color(40,0,200), color(123,213));
fill(0,121,0);
ellipse(width/2,height, width,rboden); // Boden // Ellipse überschreibt alles
// Bäume
tree(width/8,height-60); // händisch positioniert
tree(width/3+30,height-100); // händisch positioniert
tree(width/2+100,height-100); // händisch positioniert
tree(width-100,height-80); // händisch positioniert
}
// --------------- eigene Funktionen Häuser -----------------
void house (int x,int y, int h, color c, color cr) {
fill (c);
rect (x,y,h,h); // Mauern
//fill(255,0,255);
fill (0);
rect (x+70,y-50,h/12,h/3); //Rauchfang
fill (cr); //color roof
triangle (x,y,x+h,y,x+h/2,y-h/2); // roof
fill (255);
rect (x+10,y+10,h/5,h/5); // Fenster links
rect (x+70,y+10,h/5,h/5); // Fenster rechts
fill (0);
rect (x+40,y+70,h/5,h/3); //Eingangstür
}
// --------------- eigene Funktionen Bäume -----------------
void tree(int x, int y) {
int brown = color(139, 69, 19); // Stamm
fill(brown);
int green = color(34, 139, 34);
rect(x-10, y-10, 20, 45);
fill(green);
triangle(x-30, y-10, x, y-50, x+30, y-10);
triangle(x-30, y-30, x, y-70, x+30, y-30);
}
// --------------- eigene Funktionen Wolken-----------------
void clouds(int xposition, int yposition) {
// Wolke 1
fill(150,230,250);
ellipse(xposition+moveX, yposition, 115, 80);
if(moveX==width+100){
moveX=-100;
}
fill(150,230,250);
ellipse(xposition+moveX, yposition+40, 140, 40);
if(moveX==width+100) {
moveX=-100;
}
}