newt that would make a saw wave?
set sprite z elevation to:
sin((timer+{offset})*{period scaler})*{range}
this has pretty much everything you need to do what the sine movement does in its entirety. randomizations require a second step, but first let me explain the different {fancy bracket stuff}
those are all adjustable parameters.
offset, will be a number from 0-359 anything higher or lower will just make it harder to read because of loop-back in the phase.
<img src="http://hobohome.com/news/wp-content/uploads/2009/10/sinewave.gif">
this parameter will act like the offset in the sine behavior, except its not in percentage.
if you wanna know how much of a percentage of offset it is, simply check what your desired offset over 360 is. like an offset of 90, would be 90/360=1/4= 25% i assume your smart enough to figure out what a desired percentage would be (cross multiply some stuff i dont feel like explaining it its simple math)
the {period scaler} adjusts the length of the period. i think timer is always gonna be running at millisecond speed. so it normally takes 360 milliseconds to complete a full period (again all has to do with sine phase) if you have a period scaler of .5 itll take 720 milliseconds, because itll be half as slow, and of course a scaler of 2 will take 180 milliseconds. if you wanna have an exact amount of time
i think you would have to do this to get it
desired length in millisecs/360
and use that as the period scaler parameter
range parameter is simply, well... range.
if you wanna randomize things, use private variables for each of the parameters, and at startup
add a random(x) to the desired starting value.
thats pretty much all you need to know to mimic sine behavior, its really not all that complicated if you know what you're doing.