is there a shorter way to do this?
PHP Code:
if ( player.dir == 0) {
if ( tiletype( int( this.x), int(this.y-1)) != 22)
goto( int(this.x), int(this.y-1));
}
else if ( player.dir == 1) {
if ( tiletype( int(this.x-1), int(this.y)) != 22)
goto( int(this.x-1), int(this.y));
}
else if ( player.dir == 2) {
if ( tiletype( int(this.x), int(this.y+1)) != 22)
goto( int(this.x), int(this.y+1));
}
else if ( player.dir == 3) {
if ( tiletype( int(this.x+1), int(this.y)) != 22)
goto( int(this.x+1), int(this.y));
}