Fireworks Question

Hi, I have followed this great tutorial by @shiffman

And am trying to weak one aspect of the animation without affecting other properties.

Basically I want the tail (start of the firework) to shoot up faster but everything else to keep as it is.

I thought I could just change the values in this line of code.

this.vel = createVector(0, random(-22, -16))

Which does work but the firework shoots out of the top of frame. I then adjusted the gravity to push it back down and but now the firework “bloom” doesn’t look as good.

I am in a crunch for a fun project and this is driving me nuts…

Any advice?

1 Like

please link to your
https://editor.p5js.org/
project with the copy of
https://github.com/CodingTrain/website/tree/master/CodingChallenges/CC_027_FireWorks/P5 ,
where you indicate in what file
// particle.js
you play with what line
// line 14
like
this.vel = createVector(0, random(-20, -10)); // change PHIL ?


this might make it possible for someone to follow you and has a easy start to play with it.
( like see the code and the result )

1 Like

Thanks for the suggestions… I totally should have known better…

Here is my sketch
https://editor.p5js.org/phil/sketches/0oCOym6Zj

All the code is in the one file, no need for particle.js

If was thinking that adjusting the values in line 132 would make the firework faster… It certainly does but shoots of screen.

Thanks

Phil

2 Likes