Using Fireworks.



Back to Contents



First, make sure you have:

(as of June 2020)

This isn't a true tutorial, just pointers:
Look in scripts/firework.js for a simple firework particle effect.

Firework:
  • Launch multiple with launchRandomFireworks(minCount,maxCount,minThrust,maxThrust,minAlt,maxAlt,minX,maxX,spawn,gravity,millisPerFrame,timeToLive,finalLaunchTime, optional fireworkStopEvent)
    where:
    • minCount,maxCount are the potential number of fireworks to use (inclusive)
    • minThrust,maxThrust are the potential speeds of the fireworks (pixels per frame.
    • minAlt,maxAlt are the potential heights before the fireworks explode.
    • minX,maxX, are the range of potential X coordinates the firework may launch from.
    • spawn is how many particles spawn off of a single firework
    • gravity is the pull of gravity per frame
    • millisPerFrame is the length between each update interval, Note that almost all of these values depend on this update interval.
    • timeToLiveis how long the fireworks exist before being cleared
    • finalLaunchTime is the longest time to wait before a firework can be launched. The first firework always launches immediately.
    • optional fireworkStopEventA function to call when the fireworks are considered stopped
  • Stop the fireworks with cancelFireworks().



Auto Scroller:
  • Start with rewardAutoScrollStart();
  • Stop with rewardAutoScrollStop(); If tying this in with fireworks, call this with fireworkStopEvent above.