Prev: 47687 Up: Map Next: 47755
47715: Check Crosshair On Outlaw
Used by the routine at HandleWaitingOutlaw.
Checks whether the player's shot is on the outlaw. The outlaw cannot be hit once he has fired his first shot.
Input
IX The address of the outlaw
Output
F The carry flag is set if the outlaw has been hit
Return unless the player's shot is in the air.
CheckCrosshairOnOutlaw 47715 LD A,(41490) Return if ShotsFiredCount is not zero.
47718 AND A
47719 RET NZ
47720 LD IY,41805 Point IY at the fourteenth object slot, which holds the player's shot.
47724 LD A,(IY+0) Return if the shot slot is not in use.
47727 AND A
47728 RET Z
Test whether the shot is on the outlaw.
47729 LD A,(IX+2) Fetch the horizontal position of the outlaw.
47732 ADD A,4 Move four pixels to the right.
47734 SUB (IY+2) Subtract the horizontal position of the shot.
47737 NEG Make it positive.
47739 CP 24 Return if the shot is 24 or more to the side.
47741 RET NC
47742 LD A,(IX+4) Fetch the vertical position of the outlaw.
47745 ADD A,12 Move twelve pixels up.
47747 SUB (IY+4) Subtract the vertical position of the shot.
47750 NEG Make it positive.
47752 CP 48 Compare it with forty eight.
47754 RET Return with the carry flag set if the shot is on the outlaw.
Prev: 47687 Up: Map Next: 47755