Thread: Faeries
View Single Post
  #2  
Old 10-13-2001, 02:46 AM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
NPC Code:
if (created) {
setimg light2.png;
setcoloreffect 0.5,0.5,0.5,0.9;
setzoomeffect 0.1;
timeout=0.05;
this.speed=0.5;
}
if (timeout) {
this.i=(this.i+1)%20;
if (this.i==0) this.dir=int(random(0,4));
if (!((x in |0,63)||(y in |0,63|))) this.dir=(this.dir+2)%4;
x+=vecx(this.dir)*this.speed;
y+=vecy(this.dir)*this.speed;
timeout=0.05;
}

Should work, although I haven't scripted in months so it might not actually work...
__________________

Reply With Quote