xxxxxxxxxx
20
let penduls = [];
let spacing = 10;
let gravity = 1;
function setup() {
createCanvas(windowWidth, windowHeight);
let total = floor(height / spacing);
for (let i = 0; i < total; i++) {
penduls[i] = new Pendulum(width/2, 0, spacing + i * spacing, 30);
}
}
function draw() {
background(112, 50, 126, 10);
for (let pendul of penduls) {
pendul.update();
pendul.show();
}
}