We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I would like to modify the code from Daniel Shiffman's coding challenge so that it looks like the following: http://www.secondstep.dk/p5doodles/fireworks/
Could anyone tell me which parts of the code I should change?
Answers
It's worth mentioning that the code for the fireworks you've linked to is here:
http://www.secondstep.dk/p5doodles/fireworks/sketch.js
So if you want it to look the same, well, the code is right there.
If you really do want to edit your own code, start by formatting it properly in your post:
https://forum.processing.org/two/discussion/15473/readme-how-to-format-code-and-text#latest
Thank you for the comment! So when I copy paste the code from the link to Processing I get an error message that says "badly formed character (expecting quote,got g)." Could you tell me how to fix this or run the code properly in Processing? I am new to coding and am very lost...thank you so much in advance!
line 22, these should be double quotes.
oddly, that's also in the code here
http://www.secondstep.dk/p5doodles/fireworks/sketch.js
which works perfectly for me if i cut and paste it into processing editor (NB p5.js mode)
Thank you sooo much! it works now!
One last question, I am trying to work on a project and would like use minim or sound from the library to make the fireworks burst when the microphone of the computer detects sound. I would like different number of fireworks to shoot depending on the amplitude of the sound. So for instance, if the amplitude is low (i.e. 0.3) three small fireworks shoot up, and if the amplitude is higher (i.e. 0.8) five large fireworks burst. My abilities with coding is very basic and would appreciate it if anyone could modify the above code to make this work in p5.js mode.
Your answer would be of tremendous help.
@Tfguy44 and/or @kooogs - how did you find the code based on the source html? (it's a nice animation and I wanted to read the code for it but couldn't figure out how to find the code from the page content - it must be there though!)
Hit CTRL+U there. :ar!