bounces = 5; decay = 2; delay = .2; // delay between animation of nearest units dur = .3; // unit animation duration myDelay = (textIndex - 1) * delay; t = time - (inPoint + myDelay); startVal = 200; endVal = 0; freq = 1 / dur; mult = (bounces - Math.floor(t * freq)) / bounces; if (t < dur) { linear(t, 0, dur, startVal, endVal); } else { amp = (endVal - startVal) / dur; endVal - (amp / 10) * (Math.abs(Math.sin(freq * t * Math.PI)) * Math.pow(mult, decay)); }