, canvas.height);

  if (Math.random() < 0.05) {
    fireworks.push(new Firework());
  }

  for (let i = fireworks.length - 1; i >= 0; i--) {
    fireworks[i].update();
    fireworks[i].draw();

    if (fireworks[i].shouldExplode) {
      for (let j = 0; j < 50; j++) {
        particles.push(
          new Particle(
            fireworks[i].x,
            fireworks[i].y,
            fireworks[i].r,
            fireworks[i].g,
            fireworks[i].b
          )
        );
      }
      fireworks.splice(i