class AsteroidSystem { //creates arrays to store each asteroid's data constructor(){ this.locations = []; this.velocities = []; this.accelerations = []; this.diams = []; } run(multiplier){ this.spawn(multiplier); this.move(); this.draw(); } // spawns asteroid at random intervals spawn(multiplier){ if (random(1) < 0.01 * multiplier){ this.accelerations.push(new createVector(0,random(0.1,1))); this.velocities.push(new createVector(0, 0)); this.locations.push(new createVector(random(width), 0)); this.diams.push(random(30,50)); } } //moves all asteroids move(){ for (var i=0; i