Prev: 43189 Up: Map Next: 43339
43235: Game Over
Set up altering the "game-over-0up" message for 1UP.
GameOver_1UP_Messaging 43235 LD A,"1"+128 A="1" + 128 (escape 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=47570.
43255 CALL 47548 Call 47548.
Set a lower delay period for the following test.
43258 LD B,4 B=4 (delay loop counter).
43260 LD A,(24720) A=24720-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 B=8 (delay loop counter).
GameOverDelay 43298 LD HL,0 HL=0000.
From HL being set above, note that decrementing 0000 by one gives 65535.
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 delay loop counter by one and loop back to GameOverDelay_Loop until the counter 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 (escape 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