I'm making a game where you must answer a question within a time. That time reduces as your score increases. I'm doing that using this function.
var getTime = function(score){
var maxTime = 5000,
minTime = 750;
var reducedTime = maxTime * ( 1 - ( score * .1 ) );
return Math.max( reducedTime, minTime );
}
See a fiddle here - http://jsfiddle.net/QWV82/
I want to change my function so that the reduction in time eases out. I was hoping to use one of Robert Penners easing equations.
// t: current time, b: begInnIng value, c: change In value, d: duration
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
}
I'm not sure if it possible to apply my system to his equations. I can't figure out what I should be passing to the function.
Is this possible? An explanation on what I need to do would be fantastic.