Prev: C048 Up: Map Next: C069
C050: Nudge along V
For a doorway in a wall of constant U: nothing if the robot faces along V (his legs mirrored) or is on the middle line already, otherwise +1 or -1 into +$0F of his legs, towards it, which the walk (CALC_PLYR_DUV) adds to his step in V when he next walks. This is why he slides into line with a doorway as he walks through.
Only while he faces through the doorway: Knight Lore (adj_ew) and Pentagram (NUDGE_ALONG_V) nudge whichever way he faces.
Input
IX the pillar, holding the middle at +$09 to +$0B
IY the robot's legs
NUDGE_ALONG_V C050 BIT 6,(IY+$07) facing along V: no nudge
C054 JR NZ,NUDGE_DONE
C056 LD A,(IX+$0A) on the middle line already
C059 CP (IY+$02)
C05C JR Z,NUDGE_DONE
C05E LD A,$01 +1 if the middle is at a greater V, else -1
C060 JR NC,NUDGE_ALONG_V_0
C062 NEG
NUDGE_ALONG_V_0 C064 LD (IY+$0F),A the V nudge
C067 JR NUDGE_DONE
Prev: C048 Up: Map Next: C069