// paramters = colors + height
void setup() {
size(400,400);
background(42, 44, 50);
noStroke();
smooth();
noLoop();
}
void draw() {
// row 1
b(80, 40, 80, 25);
b(160, 40, 110, 50);
b(240, 40, 150, 75);
// row 2
b(80, 160, 150, 75);
b(160, 160, 80, 50);
b(240, 160, 110, 25);
// row 3
b(80, 280, 110, 25);
b(160, 280, 150, 50);
b(240, 280, 80, 100);
}
//int c stands for color
void b(int x, int y, int c, int h) {
// main building
int bwidth= 60;
int bheight = h;
fill(75, 80, c);
rect(x, y, bwidth, bheight);
// roof base
fill(c);
rect(x, y-4, 60, 3);
// offset roof base 1
fill(c);
rect(x-5, y-8, 60, 3);
// offset roof base 2
fill(c);
rect(x, y-12, 60, 3);
// roof top
fill(255);
triangle(x, y-14, x+55, y-14, x+50, y-30);
// side ornamentations
fill(0);
rect(x, y, 5, h);
fill(0);
rect(x+6, y, 5, h);
fill(0);
rect(x+60, y, 5, h);
fill(0);
rect(x+54, y, 5, h);
// door
fill(0);
rect(x+30, y+h-17, 5, 15);
}Scott - I
on Wednesday, Oct 22, 2008 – 3:14 am