NPC Code:
// NPC made by screen_name
if (created) {
this.wm = 0; // Walking mode
setimgpart aurorareddragon.gif,dir*45,dir*this.wm,45,45;
this.random = random(0,1);
timeout = .2;
}
if (timeout) {
if (this.random in |0,0.4|) {
dir=int(this.random*10);
}
this.random = random(0,1);
setimgpart aurorareddragon.gif,dir*45,this.wm*45,45,45;
this.wm = abs(this.wm-1);
this.random = random(0,1);
x+=vecx(dir);
y+=vecy(dir);
timeout = .2
}