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

29 lines
835 B
JavaScript

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