xxxxxxxxxx
31
/*
----- Coding Tutorial by Patt Vira -----
Name: Bouncing Ball Array (OOP) #1
Video Tutorial: https://youtu.be/gOtLcEC-4NM?si=JH2P3ZFeg7k9rSxa
Connect with Patt: @pattvira
https://www.pattvira.com/
----------------------------------------
*/
let balls = [];
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
for (let i=0; i<balls.length; i++){
balls[i].drawCircle();
balls[i].moveCircle();
balls[i].checkBoundary();
}
}
function mousePressed(){
balls.push(new Ball(mouseX, mouseY));
}