erikwatson / snowfall.js

Stay cool ☃️
https://erikwatson.github.io/snowfall.js/
MIT License
4 stars 2 forks source link

Drop the number of snowflakes if a slow frame rate is detected #4

Open erikwatson opened 6 years ago

erikwatson commented 6 years ago

Check the frame time, if it's under 16ms then we need to lower the number of snowflakes.

We can't just check the frame time of THIS frame, we need to average the frame times over some amount of time, or maybe a median instead.

When changing the number of snowflakes, it would probably be good to ignore the frame rate for a single average time period.