View Single Post
  #6  
Old 08-13-2001, 08:35 AM
Jerom Jerom is offline
Banned
Jerom's Avatar
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
Jerom is on a distinguished road
Send a message via AIM to Jerom
Re: Ok now why wont this work?

Quote:
Originally posted by Bhala
Why wont this work?

NPC Code:
if (playerenters) {
drawunderplayer;
dontblock;
timereverywhere;
timeout = .5;
}
if (timeout){
this.dir = random( 1, 5 );
if (this.dir=1 && !onwall(x+1,y)){y-=1;}
if (this.dir=2 && !onwall(x+.5,y+2)){y+=1;}
if (this.dir=3 && !onwall(x,y)){y-=1;}
if (this.dir=4 && !onwall(x,y)){y-=1;}
timeout = .5;
}

When you do random things, doesn't it also do decimals and not just whole numbers?
Reply With Quote