SOURCE

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

                    
>
console