ID:158593
 
how do i make it so you cannot move backwards or diagnal in my game?
client/Move(newloc, dir)
var/d = get_dir(mob.loc, newloc)
//block diagonal movement:
if(d&(d-1))
return 0
//block backwards movement
if(d == turn(mob.dir, 180))
return 0
//allow all other movement
return ..()
In response to Garthor
Also, don't rule out that he may even possibly mean something like strafe side to side, but he may not, and may actually turn that direction to be able to go backwards, or may not want anyone to go backwards at all.
In response to Superbike32
If I ruled out strafing I would have used the dir argument instead of using get_dir().
In response to Garthor
well, in his case he may not know how to make strafing work, but good work there too, if he asks for strafing thats when one of us will post something to help him.