Thread: Amnimal
View Single Post
  #1  
Old 04-18-2001, 08:05 AM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
My first "real" movement template... even has onwall stuff (Which is a big step for me):

NPC Code:

// NPC made by Tgf_guy
//Basic Animal Template
if(playerenters){
this.dir = 1;
timeout = 0.05;
}
if(this.dir=0&&timeout){
x ++;
timeout = 0.19;
}
if(this.dir=1&&timeout){
y ++;

timeout = 0.19;
}
if(this.dir=2&&timeout){
x --;

timeout = 0.19;
}
if(this.dir=3&&timeout){
y --;

timeout = 0.19;
}
if(onwall(x +3,y)){
this.dir = 2;
timeout = 0.19;
}
if(onwall(x -3,y)){
this.dir = 0;
timeout = 0.19;
}
if(onwall(x,y +3)){
this.dir = 3;
timeout = 0.19;
}
if(onwall(x,y -3)){
this.dir = 1;
timeout = 0.19;
}



I know it's long. If Kyle is still there, maybe he could help me shorten it.
Reply With Quote