I wanted to do a simple blinking-effect for my animations, and put this code into the eyes:
var timeDelay = 2000;
setFrameTimer = function(){
if ( (Math.random(1)*100) > 90 ) {
blink();
}
}
setInterval (setFrameTimer, timeDelay);
Nice and easy, right, giving the eyes a 10 percent chance of blinking every two seconds.
Well, it works nicely in the beginning. But then, after a while, the blinking increases until finally the animations are blinking constantly.
Whyyyy? It just shouldnt happen, right?