Prev: B6EF Up: Map Next: B716
B6F9: Walking legs (types 144 to 149 and 152 to 157)
The lower half of a guard or of the wizard: the second record in the guard_ew (guard_ew), guard_square (guard_square) and wizard (wizard) layouts. It is 6 pixels lower on the screen than the body it goes with (compare adj_m6_m12 with adj_p3_m12), has no height and is not solid, and uses the same sprites as the player's own legs, types 16 to 29.
The legs never move themselves: the body's handler, which runs just before, copies its X, Y and deltas into this record (at IX+33 onwards from its point of view). This handler only animates. Standing still, it does nothing at all. Walking, it plays a footstep, chooses one of two views -- types 144-149 or 152-157, bit 3 of the type -- and whether to mirror it, from the direction of travel, and steps the six-frame walk cycle (animate_human_legs).
The direction test compares dX and dY as unsigned bytes, which works because only one of them is ever non-zero and a negative step is a large number. +X and -Y use the second view, -X and +Y the first; +Y and -Y are drawn mirrored.
upd_144_to_149_152_to_157 B6F9 CALL adj_m6_m12 pixel offsets
B6FC LD A,(IX+$09) not moving: no step, no redraw
B6FF OR (IX+$0A)
B702 RET Z
B703 CALL audio_guard_wizard footstep
B706 LD A,(IX+$09) moving along Y?
B709 CP (IX+$0A)
B70C JR C,legs_moving_in_y
B70E BIT 7,A moving -X?
B710 JR NZ,legs_face_minus_x
B712 SET 3,(IX+$00) +X: second view
Prev: B6EF Up: Map Next: B716