Review 1
let x = 280;
let y = -100;
let diam = 10;
let direction = 0.5;
let a = 0;
let centX, centY;
function setup() {
createCanvas(1280, 720);
}
function draw() {
background(220);
frameRate(24);
fill(100);
for (let y = 0; y <= height; y += 40) {
for (let x = 0; x <= width; x += 40) {
fill(255, 140, 15);
ellipse(x, y, 40, 40);
}
}
fill(100);
quad(0, 720, 200, 600, 1000, 600, 1280, 720);
fill(190);
quad(0, 720, 200, 600, 200, 0, 0, 0);
quad(1000, 600, 1280, 720, 1280, 0, 1000, 0);
triangle(700, 650, 500, 350, 400, 650);
fill(120);
triangle(500, 350, 700, 650, 800, 620);
fill(160);
triangle(500, 350, 600, 100, 700, 530);
fill(240);
triangle(500, 350, 600, 100, 300, 300);
fill(220);
triangle(500, 350, 400, 650, 300, 300);
if (diam >= 100 || diam <= 0) {
direction *= -1;
}
centX = mouseX;
centY = mouseY;
fill(255, 0);
fill(0, 0, 170);
ellipse(centX, centY, diam, diam);
diam += 10 * direction;
}
Comments
Post a Comment