xxxxxxxxxx
36
let a = 0;
function setup() {
createCanvas(600,600);
background(220);
angleMode(DEGREES);
}
function draw() {
//background(220);
shape(20,20,30,30);
shape(40,50,20,30);
shape(60,30,60,60);
a = a + 50;
//automate a
}
//push - start a specific set of instructions (special)
//pop - end the specific set of instructions
function shape(x,y,w,h){
push();
translate(width/2, height/2);
rotate(a);
//automate a
fill(60,0,40,random(10));
stroke(1,1);
beginShape();
vertex(h*3,w*2);
vertex(w*3, h+w*2);
vertex(y*3, x*2);
vertex(x*2,y*2);
endShape(CLOSE);
pop();
}