SOURCE

let speed=3;
let d=50;
let x;
let y;
let c=0;
function setup(){
    createCanvas(300,300);
    x=width/2;
    y=height/2;
    colorMode(HSB,360,100,100,1);
}
function draw(){
    if(mouseIsPressed==true){
        x=mouseX+random(-speed,speed);
        y=mouseY+random(-speed,speed);
        ellipse(x,y,d,d);
    }
    c+=0.1;
    if(c>360){
        c=0;
    }
    noStroke();
    fill(c,100,100,0.5);
    x+=random(-speed,speed);
    y+=random(-speed,speed);
    x=constrain(x,0,width);
    y=constrain(y,0,height);
    rect(x,y,d,d);
}
console 命令行工具 X clear

                    
>
console