Prev: 40726 Up: Map Next: 40849
40810: Game Complete
Used by the routine at TestPlayerProgress.
Shows the "Game Complete" screen when the player has reached the end of the game (see TestPlayerProgress). The play area is cleared and the room data at Room_Special_Complete is drawn, followed by the six messages at GameComplete_Copy, and then the tune at MusicData_GameComplete is played.
The player is then left with no lives, so that HandlePlayerDeath ends the game for the player (or hands over to the other player in a two player game).
Before After
game-complete-before game-complete-after
Clear down the play area.
GameComplete 40810 CALL ClearPlayArea_Attributes Clear the attribute buffer of the play area.
40813 CALL ClearPlayArea Clear the play area.
Display the "Game Complete" screen.
40816 LD HL,50054 Point HL at the room data for the "Game Complete" screen at Room_Special_Complete.
40819 CALL DrawRoom Draw the room.
Display the "Game Complete" messaging.
40822 LD DE,40849 Point DE at the "Game Complete" messages at GameComplete_Copy.
There are six messages. Calling Poem_Loop skips setting up the counter.
40825 LD B,6 Set the message counter in B to 6.
40827 CALL Poem_Loop Print the messages.
Play the tune and then check if the game is being paused.
40830 LD DE,48231 Point DE at the tune at MusicData_GameComplete.
40833 CALL PlayMusic Play the tune.
40836 CALL PauseGame Check if the game is paused.
The game is over, so the player has no lives left.
40839 XOR A Set the number of lives in ActivePlayer_Lives to 0.
40840 LD (38589),A
40843 CALL DisplayPlayerLives Update the lives display.
40846 JP HandlePlayerDeath Jump to HandlePlayerDeath to end the game.
Prev: 40726 Up: Map Next: 40849