Prev: 43189 Up: Map Next: 43339
43235: Game Over
Prints the "GAME OVER PLAYER X" message for the player who has lost their last life. If the lunar rover was destroyed, it also prints "YOUR LUNAR ROVER HAS BEEN DESTROYED." and "ALL IS LOST." before pausing.
Set up altering the "game-over-0up" message for 1UP.
GameOver_1UP_Messaging 43235 LD A,"1"+128 A="1" + 128 (bit 7 marks the last character).
Print the altered messaging and pause to show it for a period of time.
GameOver_Write 43237 LD (43357),A Write ASCII player number to 43357.
43240 CALL CreateWindow Call CreateWindow.
Handle printing "game-over" messaging.
43243 LD DE,43339 DE=String_GameOver.
43246 LD HL,28728 HL=28728 (screen location).
43249 CALL PrintStringColour Call PrintStringColour.
43252 LD DE,47570 DE=Tune_Game_Over.
43255 CALL QueueTune Call QueueTune.
Set a lower delay period for the following test.
43258 LD B,4 Set a delay counter in B for 4 loops.
43260 LD A,(24720) A=*Rover_Slot-26.
43263 SUB 26
43265 CP 16 If the lunar rover was not destroyed, jump straight to GameOverDelay.
43267 JR C,GameOverDelay
Handle printing "lunar-rover" messaging.
43269 LD DE,43358 DE=String_Lunar_Rover.
43272 LD HL,14360 HL=14360 (screen location).
43275 CALL PrintStringColour Call PrintStringColour.
Handle printing "destroyed" messaging.
43278 LD DE,43385 DE=String_Destroyed.
43281 LD HL,18520 HL=18520 (screen location).
43284 CALL PrintStringColour Call PrintStringColour.
Handle printing "all-lost" messaging.
43287 LD DE,43397 DE=String_All_Lost.
43290 LD HL,22608 HL=22608 (screen location).
43293 CALL PrintStringColour Call PrintStringColour.
Provide a pause for us to reflect that the game has now ended.
43296 LD B,8 Set a delay counter in B for 8 loops.
GameOverDelay 43298 LD HL,0 HL=0000.
Decrementing 0000 by one gives 65535, so the inner loop runs a full 16-bit count.
GameOverDelay_Loop 43301 DEC HL Decrease HL by one.
43302 LD A,H Jump back to GameOverDelay_Loop until HL is zero.
43303 OR L
43304 JR NZ,GameOverDelay_Loop
43306 DJNZ GameOverDelay_Loop Decrease the counter by one and jump back to GameOverDelay_Loop until it is zero.
43308 RET Return.
Set up altering the "game-over-0up" message for 2UP.
GameOver_2UP_Messaging 43309 LD A,"2"+128 A="2" + 128 (bit 7 marks the last character).
43311 JR GameOver_Write Jump to GameOver_Write.
Handles checking if this is a 1UP or 2UP game.
GameOver_Check_Player_1UP 43313 LD A,(24165) If Flag_ActivePlayer is zero, jump to GameOver_1UP_Messaging.
43316 AND A
43317 JR Z,GameOver_1UP_Messaging
43319 JR GameOver_2UP_Messaging Jump to GameOver_2UP_Messaging.
Handles checking if this is a 2UP or 1UP game.
GameOver_Check_Player_2UP 43321 LD A,(24165) If Flag_ActivePlayer is not zero, jump to GameOver_2UP.
43324 AND A
43325 JR NZ,GameOver_2UP
43327 CALL GameOver_1UP_Messaging Call GameOver_1UP_Messaging.
43330 JP NewHighScore Jump to NewHighScore.
Handle 2UP, and then check if this is a new high score.
GameOver_2UP 43333 CALL GameOver_2UP_Messaging Call GameOver_2UP_Messaging.
43336 JP NewHighScore Jump to NewHighScore.
View the equivalent code in;
Prev: 43189 Up: Map Next: 43339