WalkerBuddy
Checks walker neighborhood and step suggestions
Syntax: WalkerBuddy(wa,wb,step)
wa
source walker for neighborhood checkwb
walker to check if is in neighborhoodstep
place where suggested step will be stored
Returns: This function returns a value that represents the relationship between wa
and wb
.
0
wa
is on same spot aswb
1
wa
must do a perpendicular step to reachwb
2
wa
must do a diagonal step to reachwb
3
wa
is too far to reachwb
in one single step
Notes: This function checks if wb
is in close neighborhood to wa
. It also suggests a step which wa
can perform to reach the spot of wb
. In case wb
is too far away from wa
number 3 is returned and step is filled by STEP_NONE
.
Example:
if(WalkerBuddy(wa,wb,step)<3) {...}
, ifwb
is close towa
do ...WalkerBuddy(wa,wb,step)
, ifwb
is close towa
, put the step into step
Last updated
Was this helpful?