Thread: Vortex
View Single Post
  #27  
Old 09-25-2001, 09:52 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
jadis:

of course that script was written in 1.1 so it is insanely complicated. and I don't mean this one down here, I mean the one that was made by Bruges.

NPC Code:


if (playerenters||timeout) {
this.speed = .2;
timeout = .05;
if (playerdir<3) playerdir++;
else playerdir = 0;
if (abs(playerx-x)<=this.speed&&abs(playery-y)<=this.speed) {
playerx = x;
playery = y;
}
if (playery>y&&!onwall(playerx+.5,playery+1)&&!onwall (playerx+1,playery+1)&&!onwall(playerx+1.5,playery +1)) playery-=this.speed;
if (playery<y&&!onwall(playerx+.5,playery+3)&&!onwall (playerx+1,playery+3)&&!onwall(playerx+1.5,playery +3)) playery+=this.speed;
if (playerx<x&&!onwall(playerx+2.5,playery+1)&&!onwal l(playerx+2.5,playery+2)) playerx+=this.speed;
if (playerx>x&&!onwall(playerx-.5,playery+1)&&!onwall(playerx-.5,playery+2)) playerx-=this.speed;
}


Reply With Quote