xxxxxxxxxx
20
let myBall
let myBallBin
function setup() {
createCanvas(400, 400);
myBall = new bouncingBall(10,10,3,2,"purple","")
myBallBin = [myBall]
}
function draw() {
background(220);
myBall.draw();
}
function keyPressed() {
if (key === 'n') {
let newBall = new bouncingBall(10,10,3,2,"yellow")
myBallBin.push(newBall)
}
}