Prev: B99F Up: Map Next: B9CC
B9A5: Guard walking round the room, and the wizard (types 30, 31, 158 and 159)
The body of a guard_square guard (guard_square), and the wizard (wizard). Each frame it moves with the deltas it already has, then picks its next deltas from whether that move was blocked: it walks two units a frame in a straight line until it hits something, then turns a quarter and carries on. The turns always go the same way round, -X, +Y, +X, -Y, so it follows the walls of the room. It is deadly to touch.
Its legs are the next record: they get its X, Y, dX and dY every frame.
upd_30_31_158_159 B9A5 CALL adj_p3_m12 pixel offsets: 9 pixels above the legs
B9A8 CALL dec_dZ_and_update_XYZ gravity and move
B9AB CALL move_guard_wizard_NSEW the next heading, in H (dY) and L (dX)
B9AE LD (IX+$09),L set its deltas and the legs'
B9B1 LD (IX+$29),L
B9B4 LD (IX+$0A),H
B9B7 LD (IX+$2A),H
B9BA LD A,(IX+$01) the legs go where it went
B9BD LD (IX+$21),A
B9C0 LD A,(IX+$02)
B9C3 LD (IX+$22),A
B9C6 CALL set_guard_wizard_sprite choose its frame and mirroring
B9C9 JP set_deadly_wipe_and_draw_flags deadly, wipe and draw
Prev: B99F Up: Map Next: B9CC