Prev: AA76 Up: Map Next: AA9A
AA7F: Handle Cactus
Type 13: a cactus standing in the street. It goes away when the sheriff is more than two cells away. It hurts the sheriff if they touch, and it stops any bullet which hits it.
Remove the cactus if the sheriff has moved away.
HandleCactus AA7F LD C,$02 Set the distance to two cells.
AA81 CALL CheckDistance Check how close the sheriff is.
AA84 JP NC,HandleBody_Remove Remove the cactus if the sheriff has moved away.
Hurt the sheriff or stop a bullet which hits it.
AA87 CALL CheckSheriffTouch Check whether the cactus is touching the sheriff.
AA8A JP C,KillSheriff Hurt the sheriff if it is.
AA8D CALL CheckBulletHit Check whether a bullet has hit the cactus.
AA90 RET NC Return if not.
AA91 LD (IY+$00),$07 Turn the bullet into a puff of smoke.
AA95 LD (IY+$0C),$02 Set the length of the puff to two frames.
AA99 RET Return.
Prev: AA76 Up: Map Next: AA9A