Prev: 8E26 Up: Map Next: 8ED7
8EA0: Take a life and start the player sinking
The single way out of the game. Both food penalties and the steady drain arrive here when the life force reaches zero, and with no lives left it goes straight to GAME_OVER.
Otherwise the player is not moved or hidden -- their sprite is changed to $67, which ACTOR_HANDLERS sends to DYING, and the character they were is put in +$07 for MATERIALISING to restore. Nothing else has to know a death has happened; the sprite byte carries the whole state.
Watched live by starving the player: lives went 3 to 2, the sprite went $08 to $67 to $66, the life force came back as $F0, and a gravestone appeared in the first of the four drop slots at the exact spot the player fell.
LOSE_LIFE 8EA0 LD A,($5E21) No lives left...
8EA3 AND A
8EA4 JP Z,GAME_OVER ...so that is the end of the game.
8EA7 DEC A Otherwise pay one.
8EA8 LD ($5E21),A
8EAB LD A,(IX+$00) Was the thing that died a player at all? Sprites $01 to $30 are.
8EAE DEC A
8EAF CP $30
8EB1 JR C,LOSE_LIFE_1
8EB3 LD A,($EA90)
LOSE_LIFE_0 8EB6 LD ($EA97),A Remember what to come back as.
8EB9 CALL SPRITE_ADDRESS
8EBC LD A,(DE)
8EBD LD ($EA96),A
8EC0 LD A,$67 $67 -- the sinking animation, which the dispatcher will find on the next pass.
8EC2 LD ($EA90),A
8EC5 RET
LOSE_LIFE_1 8EC6 LD A,($5E16) The player's own handler found the zero: put the player back where this frame began, from the workspace. When something else took the last unit, the player stays where he is.
8EC9 LD ($EA93),A
8ECC LD A,($5E17)
8ECF LD ($EA94),A
8ED2 LD A,($5E15)
8ED5 JR LOSE_LIFE_0
Prev: 8E26 Up: Map Next: 8ED7