Sliding Average snippet
Posted: Thu Jan 03, 2013 1:25 pm
I made a simple module that lets you make a sliding average within a certain limit.
sliding.lua snippet
I made it to be able to average the number of clicks/button presses in a window of a certain number of seconds.
So every time in your update() step, you save the number of clicks that happened since your last update.
I'm still not very confident that this is a good solution. Could someone take a look and see if I'm doing anything stupid, or if there's a more elegant solution?
sliding.lua snippet
I made it to be able to average the number of clicks/button presses in a window of a certain number of seconds.
So every time in your update() step, you save the number of clicks that happened since your last update.
I'm still not very confident that this is a good solution. Could someone take a look and see if I'm doing anything stupid, or if there's a more elegant solution?