xxxxxxxxxx
24
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
// Example 1-2: Bouncing Ball, with p5.Vector!
let b;
let ball = [];
function setup() {
//frameRate(12);
createCanvas(640, 360);
for (var i = 0; i < 30; i++) {
ball[i] = createBall();
}
}
function draw() {
background(255);
for (var i = 0; i < 30; i++) {
ball[i].update();
ball[i].display();
}
}