WalkerDiff
Calculates distance in 2D coordinate system and hints the next step
Syntax: WalkerDiff(wa,wb,dx,dy)
wawalker or index of spot Awbwalker or index of spot Bdxplace to store the difference in x coordinatedyplace to store thedifference in y coordinate
Returns:
Immediate return value gives step type describing how
washould continue to meetwbSTEP_NOTHINGwalkers are at same spot or at opposite sidesSTEP ...if walkerwaproceeds with this step, he will be closer towb
Notes: dx and dy will contain values that represent the number of steps in each direction that walker wa would have to make to reach wb in the order of dx and dy. If wa would continue by the given suggested step and then ask for another one, finally it would reach wb. The returned step is determined by the highest absolute value between dx and dy. dx relates to STEP_FORWARD and STEP_BACKWARDS, while dy is STEP_LEFT and STEP_RIGHT. If wa is on the opposite side of wb, then STEP_NOTHING is performed and returned.
Example: WalkerDiff(23, GetCursor(),dx,dy), difference from index 23 to actual cursor
See also: WalkerStepTo, GetCursor, ReadAcc
Last updated