this is an NPC i made for running, it allows every direction (360) it's easier this way I think any way. BTW, this doesn't have gani's in or anything, and it lets you run over walls, which is something I'm working on now (minor problem) sorry, im terrible w/ formatting
NPC Code:
// NPC made by Excaliber (Manager)
if(playerenters){
toweapons run
}
if(isweapon&&keypressed&&strequals(#p(1),I)&&!onwa ll(playerx,playery-2) &&playerhearts=playerfullhearts){
freezeplayer .05;
playery=playery-1.5
}
if(isweapon){
timeout=.05
}
if(timeout){
for (i=0;i<4;i++) {
if (keydown(i)) {
if(!onwall(playerx+vecx(i)*1.6,playery+vecy(i)*1.6 )){
playerx=playerx+vecx(i)*1.25;
playery=playery+vecy(i)*1.25;
}
}
}
}