Hehe I was going to suggest Sine but figured I'd keep your original code. Another two ways you can try are the LiteTween plugin:

viewtopic.php?t=70700&start=0#355295Or using simple math and no plugins, LERP:

what-is-lerp-2-minute-tutorial-for-the-non-math_t60509So for your object you create variables:

StartX, StartY, EndX, EndY, and T

Then every tick set wave position to X: lerp(wave.StartX, wave.EndX, T) and Y: lerp(wave.StartY, wave.EndY, T)

T represents a value between 0 and 1, (or 0% and 100%), so 0 for T is StartX,StartY and 1 for T is EndX,EndY, and 0.5 for T would be half-way between them.

StartX and EndX would be the same value (the randomly picked one) based on the code you had before.

Another variable could be used on the wave object to detect where in the cycle it is (eg: 0 = go down, 1 = at bottom, 2 = going up, 3 = at top) and a variable to say how many times it should loop (on creating set it to 3, and when cycle = 3 subtract 1 from loops and set cycle back to 0, when the loops are <= 0 then you can say "destroy" and make a new one).

Hope that helps!