jetpac | Routines |
Prev: 60a7 | Up: Map | Next: 6144 |
Resets level states/buffers, and checks if it's game over for a player. Used by the routine at 687a.
|
||||
60b7 | ld hl,$5d48 | HL=Jetman thruster animation object | ||
60ba | ld b,$0a | Reset all object states to be inactive | ||
60bc | call $6629 | |||
60bf | ld hl,$5d3c | |||
60c2 | res 1,(hl) | Set to unused state | ||
60c4 | ld hl,$5d44 | |||
60c7 | res 1,(hl) | Set to unused state | ||
Check if current and inactive player has lives, if not it is game over.
|
||||
60c9 | ld a,($5cf3) | Game Options | ||
60cc | and $01 | |||
60ce | jr nz,$60dd | Jump if two player | ||
60d0 | ld a,($5df1) | Current player lives | ||
60d3 | and a | |||
60d4 | jp z,$612f | Game over if no lives remaining | ||
60d7 | call $6094 | Initialise a new level | ||
60da | jp $6174 | Initialise next player | ||
60dd | ld a,($5df9) | Inactive player lives | ||
60e0 | and a | |||
60e1 | jr z,$60d0 | Game over if no lives remaining | ||
60e3 | ld a,($5df1) | Current player lives | ||
60e6 | and a | |||
60e7 | call z,$6127 | Game over if no lives remaining | ||
60ea | call $6144 | Switch players | ||
60ed | ld a,($5dd1) | Change current player (flip bits between $00 and $FF) | ||
60f0 | cpl | |||
60f1 | ld ($5dd1),a | |||
Switch rocket objects data for this new player
|
||||
60f4 | ld a,($5d34) | |||
60f7 | rlca | Calculate the offset | ||
60f8 | rlca | |||
60f9 | rlca | |||
60fa | and $38 | |||
60fc | call $6ec2 | Copy rocket sprite to buffer | ||
60ff | call $6094 | Initialise level | ||
6102 | jp $6174 | Initialise player | ||
Display the GAME OVER message for a player.
|
||||
6105 | ld a,$b1 | ASCII character for the number "1" + EOL bit | ||
6107 | ld ($6173),a | |||
610a | call $6064 | Initialise level screen | ||
610d | ld de,$6161 | Game Over message | ||
6110 | ld hl,$7038 | Y,X coords in the display file | ||
6113 | call $7134 | Draw text to the screen | ||
After displaying the text, pause for a while.
|
||||
6116 | ld b,$04 | |||
6118 | ld hl,$0000 | |||
611b | dec hl | |||
611c | ld a,h | |||
611d | or l | |||
611e | jr nz,$611b | |||
6120 | djnz $611b | |||
6122 | ret | |||
Handle message for player #2.
|
||||
6123 | ld a,$b2 | ASCII character for the number "2" + EOL bit | ||
6125 | jr $6107 | Append the number to the text, the display it | ||
Choose which player to show Game Over message for.
|
||||
6127 | ld a,($5dd1) | Jump if current player is #1 | ||
612a | and a | |||
612b | jr z,$6105 | |||
612d | jr $6123 | else, player is #2. | ||
Game Over: update scores, show game over message, and initialise system.
|
||||
612f | call $6361 | Update the high score | ||
6132 | ld a,($5dd1) | Jump if current player is #2 | ||
6135 | and a | |||
6136 | jr nz,$613e | |||
6138 | call $6105 | Display game over for player #1 | ||
613b | jp $61c9 | Reset the game | ||
613e | call $6123 | Display game over for player #2 | ||
6141 | jp $61c9 | Reset the game |
Prev: 60a7 | Up: Map | Next: 6144 |