xxxxxxxxxx
let birds = [];
const size = 1;
function setup() {
createCanvas(600, 600);
for (let i = 0; i < size; i++) {
birds.push(new Bird(width/2 + i*5, height/2 + i*5, 10));
}
}
function draw() {
background(220);
for (let i = 0; i < size; i++) {
birds[i].display();
birds[i].tick();
for (let j = 0; j < size; j++) {
birds[i].moveAwayFrom(birds[j].position)
}
}
}
function mousePressed() {
birds.push(new Bird(width/2, height/2, 10));
}