//Position Bounce
surface = [320, 480]; //the position of the ìbounceî surface
apogee = [320, 50]; //the ìapogeeî of the bounce
period = 1.5; //the length of time from surface to apogee
t = time % (period * 2);
if (t > period) t = 2 * period - t;
linear(Math.sin(t * Math.PI / period), 0, 1, surface, apogee)