The process

Decision Making!

I decided to create a maximum amount of fireworks created so that it did not slow down the program and they could flow naturally. Therefore making basically saying the the Max Volume is greater than 12 then make 12.

var maxVol = round(vol * 100);
if (maxVol > 12){
maxVol = 12
}

I also decided to make the amount of particle explosion vary between 20 to 500 particles. This is due to researching the natural weight of the fireworks and how each one is random some have more of an explosion than others. 

//Amount of particles in explosion
this.explode = function() {
var exp = random(20, 500)
for (var i = 0; i < exp; i++) {
var p = new Particle(this.firework.pos.x, this.firework.pos.y, this.fcolor, false)
this.particles.push(p);
}
}

I also want to mention the velocity of the particles and the use of gravity has been very interesting to look at and transforming these to create the same motion of the firework has been great learning.

Leave a Reply

Your email address will not be published. Required fields are marked *