You should be able to use easeOutQuint()
like this (you need to have a maxScore
constant, as shown):
var getTime = function(score){
var maxTime = 5000,
minTime = 750,
maxScore = 100;
return maxTime + minTime - easeOutQuint(null, score, minTime, maxTime-minTime, maxScore);
}
We subtract from the sum of minTime and MaxTime because you said you wanted the output values to slope downward. So, this way the returned value will start at maxTime and end at minTime.
The parameters to the easing functions are as follows:
- x: This is actually ignored, but required by jQuery.
- t: The current input value (usually, this is a time interval, but doesn't have to be), in the range [0..d].
- b: The beginning output value.
- c: The maximum change in output value.
- d: The maximum input value (usually, this is a time interval, but doesn't have to be).