xxxxxxxxxx
23
let bubbles = [];
function setup() {
createCanvas(600, 400);
let s = second();
if (s == 10) {
for (i = 0; i < 1; i++) {
let x = random(width);
let y = random(height);
let d = random(20, 50);
bubbles[i] = new Bubble(x, y, d);
}
}
}
function draw() {
background(0);
for (i = 0; i < bubbles.length; i++) {
bubbles[i].show();
bubbles[i].move();
bubbles[i].back();
}
}