function setup() { createCanvas(400, 400); angleMode(DEGREES); frameRate(60); noCursor(); } function draw() { background("skyblue"); // 移动原点坐标 push(); translate(mouseX, mouseY); // 画阳光 stroke("#FFFF00"); strokeWeight(8); let distance = 1 + (frameCount % 30); for (let i = 0, n = 36; i < n; i++) { line(0, -50 - distance * 10, 0, -100 - distance * 10); rotate(360 / n); } // 画太阳 fill("#FFCC00"); circle(0, 0, 100); noFill(); arc(-20, 0, 20, 20, -135, -45); arc(20, 0, 20, 20, -135, -45); arc(0, 10, 40, 40, 45, 135); pop(); noStroke(); fill(0); text("作品:太阳公公", 30, height - 70); text("作者:赵海洋爸爸", 30, height - 50); text("日期:2022/12/11", 30, height - 30); }