first thing:
make a better keydown-routine with for loops
for(this.i=0;this.i<4;this.i++){
if(keydown(this.i)){
if(!onwall(playerx+1.5+vecx(this.i)*.5,playery+2+v ecy(this.i)*.5)){
playerx+=vecx(this.i)*.5;
playery+=vecy(this.i)*.5;
playerdir=this.i;
}
}
}
it's not a good onwall check but I dont want to write too much
I would also use triggeractions for filling up but I think there is a better way then this I think of, if u use NPC-Server...