//#CLIENTSIDE
function onCreated()
{
temp.rand = int(random(1, 6));
setimg( format("blookat-clouds.gif", temp.rand) );
setcoloreffect(0.4, 0.4, 0.4, 0.4);
setzoomeffect(6);
dontblock();
drawoverplayer();
this.speed = 1;
this.radius = 8;
this.ox = x;
this.oy = y;
setTimer(0.05);
}
function onTimeout()
{
if (this.movetick <= 0)
{
dx = random(-2, 2);
dy = random(-2, 2);
dist = (dx * dx + dy * dy) ^ 0.5;
time = (dist / this.speed);
move(dx, dy, time, 0);
this.movetick = time;
}
else
{
this.movetick -= 0.05;
}
if (this.x < (this.ox - this.radius) ||
this.y < this.oy - this.radius ||
this.y > this.oy + this.radius ||
this.x > this.ox + this.radius)
{
x = this.ox;
y = this.oy;
}
setTimer(0.05);
}