void setup() {
size(400, 400);
background(255);
}
void draw() {
building(100, 100, 85, 30); //top left
building(200, 120, 185, 10); //top middle
building(70, 50, 285, 80); //top right
building(#802323, 70, 85, 190); //middle left
building(40, 60, 185, 200); //middle middle
building(240, 80, 285, 180);//middle right
building(200, 80, 85, 315); //bottom left
building(80, 80, 185, 315); //bottom middle
building(#de1e1e, 100, 285, 295); //bottom right
}
void building(int buildingColor, int buildingHeight, int xpos, int ypos) {
int buildingWidth=30;
fill(buildingColor);
rect(xpos, ypos, 40, buildingHeight);
for(int x=xpos+3; x <= xpos+buildingWidth; x += 9) {
for(int y=ypos+4; y <= ypos+buildingHeight-20; y += 10){
fill(#f8ff35);
rect(x, y, 7, 7);
}
}
}Alexis - I
on Wednesday, Oct 22, 2008 – 9:07 am