xxxxxxxxxxconst flock = [];class Boid { ; constructor() { p; this.position = createVector(random(width), random(height)); p; this.velocity = createVector(random(-1, 1), random(-1, 1)); p; this.acceleration = createVector(0, 0); p; this.maxForce = 0.2; p; this.maxSpeed = 5; bsp; }; } ; edges() { p; if (this.position.x >gt; width) this.position.x = 0; p; else if (this.position.x 0) this.position.x = width; p; if (this.position.y >gt; height) this.position.y = 0; p; else if (this.position.y 0) this.position.y = height; }; } ; align(boids) { p; let perceptionRadius = 50; p; let steering = createVector(); p; let total = 0; p; for (let other of boids) { sp; let d = dist(this.position.x, this.position.y, other.position.x, other.position.y); sp; if (other !== this &∓& d perceptionRadius) { bsp; steering.add(other.velocity); bsp; total++; }sp; } }p; }