Having trouble getting the stars to be behind the building and the windows to be behind the water and the bridge.
float time = 0;
float[] a = new float[2000];
wall[]walls;
void setup(){
size(1000,700);
for (int i = 0; i < a.length; i++) {
a[i] = random(0, 1700);
//walls setup
walls=new wall[14];//creates an array(list) for the walls array starts at 0
walls[0]=new wall(470,300,20,20);
walls[1]=new wall(510,300,20,20);
walls[2]=new wall(470,340,20,20);
walls[3]=new wall(510,340,20,20);
walls[4]=new wall(470,380,20,20);
walls[5]=new wall(510,380,20,20);
walls[6]=new wall(470,420,20,20);
walls[7]=new wall(510,420,20,20);
walls[8]=new wall(470,460,20,20);
walls[9]=new wall(510,460,20,20);
walls[10]=new wall(470,500,20,20);
walls[11]=new wall(510,500,20,20);
walls[12]=new wall(470,540,20,20);
walls[13]=new wall(510,540,20,20);
}
}
void draw(){
background(43,47,119);
float x=0;
noStroke();
for (int i = 0; i < a.length; i++) {
a[i] += 0;
float y = i * 0.4;
fill(255,255,255);
ellipse(a[i], y, 2, 2);
}
stroke(0);
while (x<width){
line(x,520+50*noise(x/100,time),x,height);
x=x+1;
}
time=time+0.01;
noStroke();
//empire state building
fill(0,80);
rect(450,280,100,350);
rect(465,220,70,60);
rect(479,200,40,20);
rect(496,170,5,30);
//far right building
fill(0,80);
rect(850,320,300,300);
//second one from the right
fill(0,80);
rect(750,280,100,350);
//far left building
fill(0,80);
rect(0,280,100,350);
//second from the left building
fill(0,80);
rect(100,350,100,300);
moon();
car();
stroke(0);
for (int i=0;i<1000;i=i+10){
line(i,440,i,480);
}
//bridge
fill(0);
rect(0,440,1000,10);
rect(0,480,1000,20);
for (int i = 0; i < walls.length; i++){
walls[i].draw();
}
}
void car(){
fill(47,79,79);
rect(30,460,30,20);
}
void moon(){
fill(254,252,215);
noStroke();
ellipse(900, 100, 150, 150);
noStroke();
fill(43,47,119);
ellipse(880, 90,125,125);
}
//creats a class for the walls of the maze
class wall {
float x;
float y;
float w;
float h;
wall(float x1,float y1, float w1, float h1) {
x = x1;
y = y1;
w = w1;
h = h1;
}
//draws the walls
void draw() {
noStroke();
fill(255,255,224);
rect(x, y, w, h);
}
}