ID:873233
 
Keywords: pacman, proc, walk
(See the best response by Albro1.)
So far, the walk procs work well for making the mob move until it hits a wall of the maze. But I've been trying to make it so that he can only move in a direction if a wall isn't there to prevent from stopping mid walk so that turning is more fluid.

client
North()
walk(usr,NORTH,usr.rundelay)

South()
walk(usr,SOUTH,usr.rundelay)

East()
walk(usr,EAST,usr.rundelay)

West()
walk(usr,WEST,usr.rundelay)


Problem description: For each direction, what is the best way to make the mob ignore movement in a certain direction until there is a opening to do so?

Thanks in advance, guys.

Best response
So you mean you need to check if they can move before actually trying to move?

client
North()
var/turf/t = get_step(mob, NORTH)
if(t.Enter(mob))
walk(mob, NORTH)
Exactly what I was trying to do and it worked perfectly. Thanks!
No problem.