xxxxxxxxxx
/*
Katie Frank
For loops and shapes
Art 3001
February 7, 2017
*/
void setup() {
size(400, 400);
background (255);
}
void draw() {
int c = 0; // color
int d = 15; // size
for (int i = 15; i < width; i = i+35) {
for (int j = 15; j < height; j = j + 35) {
noStroke();
fill(255, c, c, 150); //red rect color
rect (i, j, d, d); //rect command
fill(c, 150, 250); //blue color
ellipse(i +5, j +5, d, d); //blue command
fill(180, c, c, 50); //black/green color
ellipse(i -3, j -3, d, d); //black/green command
if (mousePressed == true) {
c = 150;
d = 35;
} else {
c = 0;
d = 15;
}
}
}
}