NPC Code:
// NPC made by Rogue Shadow -TT-*C* (TCN) // my name
if (created){ // check to see that npc has been created
this.rain=50; // number of raindrops
setarray this.xys,this.rain*6; // define the array
timeout=.05; // start the timeout loop
}
if (timeout){ // check for timeout
for (this.i=0;this.i<6*this.rain;this.i+=6){ // for loop in 6 step intervels
this.xys[this.i]+=this.xys[this.i+2]; // add xspeed to x
this.xys[this.i+1]+=this.xys[this.i+3]; // add yspeed to y
this.xys[this.i+5]+=1; // increase distance that has elapsed
showimg this.i,@o,this.xys[this.i],this.xys[this.i+1]; // draw the rain
changeimgcolors this.i,.5,.5,1,.9; // do color effects
changeimgzoom this.i,2*(1-(this.xys[this.i+5]/this.xys[this.i+4])); // do zoom effecs by percent of completed travel
if (this.xys[this.i+5]>this.xys[this.i+4]){ // check to see if distance has exceeded distance to travel
this.xys[this.i+0]=random(0,64); // x
this.xys[this.i+1]=random(0,64); // y
this.xys[this.i+2]=random(.5,.9); // xspeed
this.xys[this.i+3]=random(.5,.9); // yspeed
this.xys[this.i+4]=random(20,30); // distance to travel
this.xys[this.i+5]=0; // distance that has elapsed
}
}
timeout=.05; // restart timeout
}
This is my 6 variable per raindrop rain script.
It is one big array. Perhaps it will show you some interesting things...