View Single Post
  #4  
Old 06-29-2002, 12:14 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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...
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote