xxxxxxxxxx
41
let r = 0;
let a = 0;
function setup() {
createCanvas(400, 400);
background(178, 150, 160);
angleMode(DEGREES);
}
function draw() {
strokeWeight(4);
fill(255, 236, 212);
shape();
fill(220, 237, 194);
shapeTwo();
r = r + 5;
a = a - 2;
}
function shape() {
push();
translate(width / 2, height / 2);
rotate(r);
beginShape();
vertex(0, -50);
vertex(-90, 100);
vertex(90, 100);
endShape(CLOSE);
pop();
}
function shapeTwo() {
translate(width / 2, height / 2);
rotate(a);
beginShape();
vertex(0, -50);
vertex(-70, -50);
vertex(-70, -120);
vertex(0, -120);
endShape(CLOSE);
}