Drifting Snow
This recipe shows how to use the TriplePlay particle system to simulate snowflakes drifting
down the screen, with random "wind" that blows them about. Note: the TriplePlay particle
system requires WebGL and therefor so does this recipe.
Live Demo
Controls
- None - just sit back and relax
Source Code
Exercises
- Make the rotation vary for different particles. You probably don't want to compute a
sin/cos for every single particle, but you could compute five or six of them and assign
them to particles based on their index.
- Make the "wind" vary for different particles. Either choose a different velocity scale
factory based on the particle's current y position, or some other differentiating
factor.
Back to cookbook.