Prev: B99F Up: Map Next: B9CC
B9A5: Handle Guard Or Wizard
Handles the top half of a guard or of the wizard, who patrol round the room, following the walls. The bottom half is the next object in the table and it is moved with the top half.
Input
IX Address of the top half of the guard
Move the guard and keep the bottom half in step.
HandleGuardOrWizard B9A5 CALL SetPixelAdjustments_GuardTop Set the pixel adjustments of a guard.
B9A8 CALL ApplyGravityAndMove Apply gravity to the guard and move it.
B9AB CALL GetGuardSpeeds Work out the speeds of the guard from its direction.
B9AE LD (IX+$09),L Set the speed in X of the guard.
B9B1 LD (IX+$29),L Set the speed in X of the bottom half.
B9B4 LD (IX+$0A),H Set the speed in Y of the guard.
B9B7 LD (IX+$2A),H Set the speed in Y of the bottom half.
B9BA LD A,(IX+$01) Fetch the X coordinate of the guard.
B9BD LD (IX+$21),A Set the X coordinate of the bottom half.
B9C0 LD A,(IX+$02) Fetch the Y coordinate of the guard.
B9C3 LD (IX+$22),A Set the Y coordinate of the bottom half.
B9C6 CALL FaceDirectionOfMovement Choose the graphic of the guard from its direction.
B9C9 JP SetDeadlyFlagsAndDraw Make the guard deadly and flag it to be drawn again.
Prev: B99F Up: Map Next: B9CC