xxxxxxxxxx
19
// All array functions & variables: https://www.w3schools.com/jsref/jsref_obj_array.asp
let bubbles = [];
function setup() {
createCanvas(600, 600);
}
function draw() {
background(0);
for(let i = 0; i < bubbles.length; i++) {
bubbles[i].show();
bubbles[i].move();
}
}
function mouseDragged() {
bubbles.push(new Bubble(mouseX, mouseY, random(10, 18)));
}