mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 20:43:26 +00:00
32 lines
999 B
JavaScript
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 = {}));
|