This function draws a Particle effect on the screen, using a very compact procedural algorithm. This means that we don't have to use an array to store x and y coordinates as well as speeds for each particle, and thus it fits in this small size. It should be noted that since for each particle multiple trigonometry calculations are done each frame, that this approach is obviously slower.
Check out a JSFiddle Demo here!
- Configurable X,Y center of explosion.
- Configurable number of particles
- Gravity in the vertical direction: Have your particles fall down or fly up!
- Seedable, each seed has its own explosion and will show exactly that explosion each time, across computers.
- Slowmotion, Fast Forward and playing explosions Backwards is all possible.
- Size:138 bytes.