Prev: 46770 Up: Map Next: 46802
46780: Lose Life
Used by the routine at EndSmoke.
Called when the robot has been destroyed. If there are no lives left then the game is over. Otherwise a life is taken away, the battery is recharged and the robot starts to materialise again.
Input
IX Pointer to the robot (entity 0)
LoseLife 46780 LD A,(38426) This load has no effect, as A is replaced immediately.
46783 LD A,(38539) Fetch the number of lives left.
46786 AND A Test whether there are any.
46787 JP Z,EndRound Jump to EndRound if there are none, as the game is over.
46790 LD HL,38539 Point HL at Lives.
46793 DEC (HL) Take away a life.
46794 CALL RechargeBattery Recharge the battery and show the number of lives left using RechargeBattery.
46797 LD (IX+0),64 Set the type of the robot to 64, the start of the sequence of sprites that shows it materialising.
46801 RET Return.
Prev: 46770 Up: Map Next: 46802