xxxxxxxxxx
31
// Do not edit the code between these comments.
// You should only edit the class Particle below.
// -----------------------------------------------
let fireworks = [];
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background("black");
for (let i=fireworks.length-1; i>=0; i--) {
fireworks[i].update();
fireworks[i].display();
}
}
function mousePressed() {
for (let i=0; i<100; i++) {
let someParticle = new Particle(mouseX, mouseY);
fireworks.push(someParticle);
}
}
// -----------------------------------------------
class Particle {
// Your code should go here!
// Make the class work as described in the quiz question...
}