Prev: 43638 Up: Map Next: 43674
43647: Handle Cactus
Type 19: 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 43647 LD C,2 Set the distance to two cells.
43649 CALL CheckDistance Check how close the sheriff is.
43652 JP NC,HandleBody_Remove Remove the cactus if the sheriff has moved away.
Hurt the sheriff or stop a bullet which hits it.
43655 CALL CheckSheriffTouch Check whether the cactus is touching the sheriff.
43658 JP C,KillSheriff Hurt the sheriff if it is.
43661 CALL CheckBulletHit Check whether a bullet has hit the cactus.
43664 RET NC Return if not.
43665 LD (IY+0),7 Turn the bullet into a puff of smoke.
43669 LD (IY+12),2 Set the length of the puff to two frames.
43673 RET Return.
Prev: 43638 Up: Map Next: 43674