Prev: D847 Up: Map Next: D88E
D865: Check Monsters Defeated
Used by the routine at StartGame.
Checks whether all four monsters have been destroyed and their fragments have gone. If so, the game is over (see GameOver). Returns if any monster is still alive, or any of its fragments is still moving.
Return if any monster is still alive.
CheckMonstersDefeated D865 LD HL,$BD5E Point HL at the first monster, set the distance from one object to the next (10 bytes), set a counter for four monsters and clear A.
D868 LD DE,$0010
D86B LD B,$04
D86D XOR A
CheckMonstersDefeated_Monsters D86E OR (HL) Combine the type of the monster with the others, and loop back until all four have been checked.
D86F ADD HL,DE
D870 DJNZ CheckMonstersDefeated_Monsters
D872 RET NZ Return if any monster is still alive.
Return if any fragment is still in the view.
D873 LD IX,$BCCE Point IX at the first of the four fragments, and set a counter for four.
D877 LD B,$04
CheckMonstersDefeated_Fragments D879 LD A,(IX+$00) Jump to CheckMonstersDefeated_Next if the object is not a fragment.
D87C SUB $8C
D87E CP $04
D880 JR NC,CheckMonstersDefeated_Next
D882 BIT 1,(IX+$07) Return if the fragment has been drawn, because it is still in view.
D886 RET NZ
CheckMonstersDefeated_Next D887 ADD IX,DE Move on to the next object and loop back until all four have been checked.
D889 DJNZ CheckMonstersDefeated_Fragments
D88B JP GameOver Finish the game.
Prev: D847 Up: Map Next: D88E