View Single Post
  #16  
Old 12-10-2001, 09:25 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
hmm...here is some ghetto crap i was working on

NPC Code:

// NPC made by Supersonic (NAT)
if (playertouchsme && !isweapon) {
toweapons Spheres of Doom;
}
if (weaponfired) {
this.on=(this.on+1)%2;
}
if (playerenters) {
this.off={-2.75,-2.5};
this.angle={0,0}
this.rotate={1,-1};
this.radius={4,10};
this.dir={1,-1};
timeout=.05;
}
if (timeout) {
if (this.on=1) {
for (i=0; i<2; i++) {
this.angle[i]+=(3*this.rotate[i])/this.radius[i];
this.radius[i]+=.1*this.dir[i];
if (this.radius[i]<4) this.dir[i]=1;
if (this.radius[i]>10) this.dir[i]=-1;
if (this.dir[i]=0) this.dir[i]++;
showimg i,light2.png,playerx+this.off[0]+sin(this.angle[i])*this.radius[i],playery+this.off[1]+cos(this.angle[i])*this.radius[i];
if (i=0) changeimgcolors i,1,0,0,.99;
if (i=1) changeimgcolors i,0,0,1,.99;
changeimgzoom i,.5;
}
}else{
for (i=0; i<2; i++) {
hideimg i;
}
}
timeout=.05;
}



It's scripted pretty scrappy, but it's okay
Reply With Quote