If you've used jQuery for simple animations, you know it's easy to make simple tweens look nice by using the variety of available easing options.
Whenever I try to do some nice effect in Graal, I end up writing the tweening code from scratch for that particular case, which is ridiculous.
Tweening is pretty easy, but to make it look nice, you need some form of easing. Animations that start and stop abruptly look bad; it's usually better for there to be some kind of slow stop, fast start, or even bouncing .
func_tween is just a couple functions that makes it easy to change the property of an object over time. You can use any object; images, GUIs, players, NPCs, etc.
function easeInOutQuad(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t + b; return -c / 2 * ((--t) * (t - 2) - 1) + b; };
function easeInCubic(x, t, b, c, d) { return c * (t /= d) * t * t + b; };
function easeOutCubic(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b; };
function easeInOutCubic(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; return c / 2 * ((t -= 2) * t * t + 2) + b; };
function easeInQuart(x, t, b, c, d) { return c * (t /= d) * t * t * t + b; };
function easeOutQuart(x, t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; };
function easeInOutQuart(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; return -c / 2 * ((t -= 2) * t * t * t - 2) + b; };
function easeInQuint(x, t, b, c, d) { return c * (t /= d) * t * t * t * t + b; };
function easeOutQuint(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; };
function easeInOutQuint(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; };
function easeInSine(x, t, b, c, d) { return -c * cos(t / d * (pi / 2)) + c + b; };
function easeOutSine(x, t, b, c, d) { return c * sin(t / d * (pi / 2)) + b; };
function easeOutCirc(x, t, b, c, d) { return c * (1 - (t = t / d - 1) * t) ^ 0.5 + b; };
function easeInOutCirc(x, t, b, c, d) { if ((t /= d / 2) < 1) return -c / 2 * ((1 - t * t) ^ 0.5 - 1) + b; return c / 2 * ((1 - (t -= 2) * t) ^ 0.5 + 1) + b; };
function easeInElastic(x, t, b, c, d) { s = 1.70158; p = 0; a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < abs(c)) { a = c; s = p / 4; } else s = p / (2 * pi) * arcsin(c / a); return -(a * 2 ^ (10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b; };
function easeOutElastic(x, t, b, c, d) { s = 1.70158; p = 0; a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < abs(c)) { a = c; s = p / 4; } else s = p / (2 * pi) * arcsin(c / a); return a * 2 ^ (-10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b; };
function easeInOutElastic(x, t, b, c, d) { s = 1.70158; p = 0; a = c; if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5); if (a < abs(c)) { a = c; s = p / 4; } else s = p / (2 * pi) * arcsin(c / a); if (t < 1) return -.5 * (a * 2 ^ (10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b; return a * 2 ^ (-10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b; };
function easeInBack(x, t, b, c, d, s) { if (s.type() == (- 1)) s = 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b; };
function easeOutBack(x, t, b, c, d, s) { if (s.type() == (- 1)) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; };
function easeInOutBack(x, t, b, c, d, s) { if (s.type() == (- 1)) s = 1.70158; if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; };
function easeInBounce(x, t, b, c, d) { return c - this.easeOutBounce(x, d - t, 0, c, d) + b; };
function easeOutBounce(x, t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; } };
function easeInOutBounce(x, t, b, c, d) { if (t < d / 2) return this.easeInBounce(x, t * 2, 0, c, d) * .5 + b; return this.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b; };
// basic ones function easeLinear(x) { return x; }