dont ask ;P
NPC Code:
timereverywhere;
dontblock;
drawunderplayer;
if (playerenters) {
this.dir=0;
timeout=.1;
}
if (timeout) {
if (onwater(x+vecx(this.dir),y+vecy(this.dir))) {
x+=vecx(this.dir);
y+=vecy(this.dir);
}
else {
this.dir=(this.dir+2)%4;
x+=vecx(this.dir);
y+=vecy(this.dir);
}
timeout=.1;
}