xxxxxxxxxx
28
function setup() {
createCanvas(300, 300);
rectMode(CENTER)
}
function draw() {
background(255);
//translate(mouseX, mouseY)
//translate(width/2, height/2)
//ellipse(0,0,140,140)
//rotate(radians(45))
for (let x=15; x<=width; x+=30 ){
push()
translate(x, height/2)
fill(0)
rotate(radians(45))
rect(0,0,30,30)
//rect(x,height/2,30,30)
pop()
}
push() //----> whatever between push and pop only effected by color red, like a block of code
fill(255,0,0)
ellipse(30,30,30,30)
pop()
}