phaser/Phaser/system/easing/Back.js
Richard Davey e74114f384 Docs
2013-08-12 00:52:35 +01:00

32 lines
999 B
JavaScript

var Phaser;
(function (Phaser) {
/// <reference path="../../Game.ts" />
/**
* Phaser - Easing - Back
*
* For use with Phaser.Tween
*/
(function (Easing) {
var Back = (function () {
function Back() { }
Back.In = function In(k) {
var s = 1.70158;
return k * k * ((s + 1) * k - s);
};
Back.Out = function Out(k) {
var s = 1.70158;
return --k * k * ((s + 1) * k + s) + 1;
};
Back.InOut = function InOut(k) {
var s = 1.70158 * 1.525;
if((k *= 2) < 1) {
return 0.5 * (k * k * ((s + 1) * k - s));
}
return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
};
return Back;
})();
Easing.Back = Back;
})(Phaser.Easing || (Phaser.Easing = {}));
var Easing = Phaser.Easing;
})(Phaser || (Phaser = {}));