I’m still pretty new to coding and web development and am trying to recreate this effect but with a circle.
So I changed the word sparkle – for example:
and that changed the shape but for some reason, it won’t fall like before? Is this the correct way to go about this? I did change it throughout the script but I can’t get it to fall like the other one.
I’m not clear what the circle effect you were hoping to see was but no, this isn’t at all the correct way, sorry!
All you really did by changing
circle the first time was effectively set the number of falling sparkles to zero, which is why they stopped falling.
There’s not much point changing variable names because they are really just labels. So for instance, if you changed every use of
circle you’re only really changing a label, not changing what the code does.
Hope it helps! I think tinkering with other peoples scripts like this is a great way to start to understand coding.
The part of the code that animates the sparkles starts from line 140 – try tweaking some of that code.
For example on line 143, I changed it to
stary[i]+=1+Math.random()*1; to make the sparkles drift down more slowly