Prev: 43533 Up: Map Next: 43626
43559: Handle Player Death
Used by the routines at GameComplete and HandlerSittingSabreman.
Called when the player has finished being shown as dead or sitting (see HandlerSittingSabreman). Depending on the number of players and the number of lives left this will either put the player back on their feet with one life less, end the game for the player, or hand over to the other player.
Input
IX Actor record of the player
Is this a one or two player game?
HandlePlayerDeath 43559 LD A,(38546) Fetch the game options from GameOptions.
43562 AND %00000001 Keep only bit 0.
43564 JR NZ,HandlePlayerDeath_TwoPlayer Jump to HandlePlayerDeath_TwoPlayer if this is a two player game.
This is a one player game.
HandlePlayerDeath_OnePlayer 43566 LD A,(38589) Jump to GameOver_ControllerRestart if the player has no lives left.
43569 AND A
43570 JR Z,GameOver_ControllerRestart
43572 LD HL,38589 Point HL at the number of lives at ActivePlayer_Lives.
43575 DEC (HL) Decrease the number of lives by one.
43576 CALL DisplayPlayerLives Update the lives display.
Put the player back on their feet with the normal colour.
43579 LD A,(IX+0) Fetch the sprite ID of the player.
43582 AND %00000111 Keep only bits 0-2.
43584 OR %00010000 Set bit 4, giving a sprite ID of 16 to 23.
43586 LD (IX+0),A Set the new sprite ID of the player.
43589 LD (IX+5),71 Set the colour of the player to INK:WHITE, PAPER:BLACK (BRIGHT).
Remove any orchid effect and delay the nastie and flame spawning.
43593 XOR A Clear the orchid effect timer in OrchidEffectTimer.
43594 LD (38576),A
43597 LD A,16 Set the nastie spawn delay in NastieSpawnDelay to 16.
43599 LD (38577),A
43602 LD A,128 Set the flame spawn delay in FlameSpawnDelay to 128.
43604 LD (38580),A
This entry point is used by the routine at HandlerSittingSabreman.
HandlePlayerDeath_Draw 43607 JP DisplayActor Jump to DisplayActor to display the player.
This is a two player game.
HandlePlayerDeath_TwoPlayer 43610 LD A,(38624) Jump to HandlePlayerDeath_OnePlayer if the other player has no lives left.
43613 AND A
43614 JR Z,HandlePlayerDeath_OnePlayer
43616 LD A,(38589) Fetch the number of lives of this player from ActivePlayer_Lives.
43619 AND A Show the game over message if this player has no lives left.
43620 CALL Z,GameOver_Controller
43623 JP SwitchPlayer Jump to SwitchPlayer to swap over to the other player.
Prev: 43533 Up: Map Next: 43626