PHP Code:
function onCreated() {
if (params[0] == "wind") {
this.la = new[8];
this.lz = new[8];
this.ls = new[8];
this.lm = new[8];
this.lr = new[8];
this.lu = 0;
this.ll = 0;
}
setTimer(.05);
}
function onTimeout() {
if (this.lu == 0) NewLeaf();
this.lu = (this.lu + 1) % 6;
for (a = 0; a < 8; a++) {
if (this.ls[a] > 0) {
this.la[a] += this.lm[a];
this.lz[a] += this.ls[a];
showimg2(a,"leaf1.png",player.x + 1 + sin(this.la[a]) * 1.5,player.y + 2 + cos(this.la[a])*.5, player.z + this.lz[a]);
findimg(a).zoom = .75;
findimg(a).rotation += this.lr[a];
if (a%3 == 0) {
findimg(a).image = "light2s.png";
findimg(a).red = findimg(a).blue = 0;
findimg(a).green = 1;
findimg(a).alpha = .9;
findimg(a).zoom = .5;
}
if (this.la[a] in |1.57,4.71|) findimg(a).layer = 0;
else findimg(a).layer = 2;
if (this.lz[a] > 3.5) this.ls[a] = 0;
}
else hideimg(a);
}
}
function NewLeaf() {
this.la[this.ll] = random(0,6.28);
this.lz[this.ll] = 0;
this.ls[this.ll] = random(.03,.1);
this.lr[this.ll] = random(0,.5);
this.lm[this.ll] = random(.3,.6);
this.ll = (this.ll+1) % 8;
}
Yep.. I have like ~60 ganis with light effects in them..