Standard easing functions for motion in Excalibur, defined on a domain of [0, duration] and a range from [+startValue,+endValue]
Given a time, the function will return a value from positive startValue to positive endValue.
functionLinear (t) { returnt * t; }
// accelerating from zero velocity functionEaseInQuad (t) { returnt * t; }
// decelerating to zero velocity functionEaseOutQuad (t) { returnt * (2 - t); }
// acceleration until halfway, then deceleration functionEaseInOutQuad (t) { returnt < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t; }
// accelerating from zero velocity functionEaseInCubic (t) { returnt * t * t; }
// decelerating to zero velocity functionEaseOutCubic (t) { return (--t) * t * t + 1; }
// acceleration until halfway, then deceleration functionEaseInOutCubic (t) { returnt < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; }
Standard easing functions for motion in Excalibur, defined on a domain of [0, duration] and a range from [+startValue,+endValue] Given a time, the function will return a value from positive startValue to positive endValue.