xxxxxxxxxx
30
let balls = []
class Ball {
constructor(){
}
}
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for(let i=0;i<balls.length;i++){
balls[i][2] += 1;
if(balls[i][1] + balls[i][2] < height){
balls[i][1] += balls[i][2];
}
else{
balls[i][1] = height - balls[i][3]*25
}
circle(balls[i][0],balls[i][1],balls[i][3]*50)
}
}
function mouseClicked(){
balls.push([mouseX,mouseY,0,random()])
}