xxxxxxxxxx
85
function setup() {
createCanvas(1000, 200);
angleMode(DEGREES);
}
function draw() {
background(220);
//square 1
fill( 240,221,150);
square(0,0,200);
fill("red");
rect(20,180,50,10); //red
fill("blue");
rect(30,20,10,50); //blue
//square 2
fill( 240,221,150);
square(200,0,200);
push();
rotate(25);
fill("red");
rect(270,10,50,10); //red
pop();
push();
rotate(25);
fill("blue");
rect(270,0 - 70 ,10,50); //blue
pop();
//square 3
square(400,0,200);
push();
rotate(0);
fill("red");
rect(460,80,50,10); //red
pop();
push();
rotate(0);
fill("blue");
rect(450,60,10,50); //blue
pop();
//square 4
square(600,0,200);
push();
rotate(15);
fill("red");
rect(680,0 - 90,50,10); //red
pop();
push();
rotate(15);
fill("blue");
rect(740,0 - 90,10,50) //blue
pop();
square(800,0,200);
push();
rotate(0);
fill("red");
rect(970,20,10,50); //red
pop();
push();
rotate(0);
fill("blue");
rect(940,180,50,10) //blue
pop();
}
function mousePressed() {
save("Rec.png");
}