Watch Fun Programming [video 30]
Here’s Mr Fun’s code:
float r;
void setup()
{
size(400,400);
background(255);
noStroke();
fill(0);
rectMode(CENTER);
r = 0;
}
void draw()
{
background(255);
translate(100,100);
rotate(r);
rect(0,0,80,80);
resetMatrix();
translate(300,100);
rotate(r);
rect(0,0,80,80);
resetMatrix();
translate(100,300);
rotate(r);
rect(0,0,80,80);
resetMatrix();
translate(300,300);
rotate(r);
rect(0,0,80,80);
r = r + 0.05;
}
Change the program so each rectangle is a different color
Change the program so there are 9 rotating rectangles
Change the program so that some of the rectangles rotate counter-clockwise.