xxxxxxxxxx
26
let p=[];
function setup() {
createCanvas(400, 400);
for(i=0;i<52;i++){
p.push(new Part());}
background(220);
}
function draw() {
for (i=0;i<p.length;i++){
p[1].show();}
}
class Part{
constructor(){
this.x=200;
this.y=380;
this.vx=random(1,-10);
this.vy=random(-1,-30);
}
show(){
ellipse(this.x,this.y,24);
this.x=this.x+this.vx;
this.y=this.y+this.vy;
}
}