# Fireworks Question

**URL:** <https://discourse.processing.org/t/fireworks-question/14564>\
**Category:** Coding Questions\
**Created:** [October 10, 2019, 2:26am UTC](https://discourse.processing.org/t/fireworks-question/14564 "2019-10-10T02:26:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philspitler](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@philspitler](https://discourse.processing.org/u/philspitler)\
**Post date:** [October 10, 2019, 2:26am UTC](https://discourse.processing.org/t/fireworks-question/14564/1 "2019-10-10T02:26:14Z")

</div>

Hi, I have followed this great tutorial by @shiffman

[![](https://img.youtube.com/vi/CKeyIbT3vXI/hqdefault.jpg "Coding Challenge #27: Fireworks!") ](https://www.youtube.com/watch?v=CKeyIbT3vXI)

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?

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [October 10, 2019, 3:40am UTC](https://discourse.processing.org/t/fireworks-question/14564/2 "2019-10-10T03:40:29Z")

</div>

please link to your  
[https://editor.p5js.org/](https://editor.p5js.org/)  
project with the copy of  
[https://github.com/CodingTrain/website/tree/master/CodingChallenges/CC\_027\_FireWorks/P5](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 )

---

<div class="post-metadata">

**Author:** ![philspitler](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@philspitler](https://discourse.processing.org/u/philspitler)\
**Post date:** [October 10, 2019, 4:01am UTC](https://discourse.processing.org/t/fireworks-question/14564/3 "2019-10-10T04:01:04Z")

</div>

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

Here is my sketch  
[https://editor.p5js.org/phil/sketches/0oCOym6Zj](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
