Here's a nifty little block sine wave.
PHP Code:
//#CLIENTSIDE
function onCreated() {
setTimer(0.05);
}
function onTimeout() {
drawSine(timevar2);
setTimer(0.05);
}
function drawSine(initial) {
temp.inc = pi / 6;
temp.radius = 64;
for (temp.i = initial; temp.i < (initial+(pi*2)+temp.inc); temp.i += temp.inc) {
temp.tx = 100 + 24 * temp.j;
temp.ty = (screenheight / 2) + temp.radius * sin(temp.i);
temp.img = showimg(200 + temp.j, "block.png", temp.tx, temp.ty);
temp.img.layer = 4;
temp.j++;
}
}
It's important because you can throw any number at it, and it'll return between -1 and 1. I only really know how it works through playing with it, so I would probably explain it wrong but we'll just have to wait for Tig and his Uni Math knowledge skills.