Prev: 58535 Up: Map Next: 58656
58553: Kill Tracked Enemy Entity
Used by the routine at Process_Tracked_Enemy_Entity.
Kill path reached when no collision-free slot is available for a tracked enemy. Steps back six bytes to the entity position fields, erases the sprite via Erase_Narrow_Entity_Sprite, removes the entity record from the list via Remove_Entity_From_List_Step, and erases the spawn buffer via Erase_Wide_Entity_Sprite. Decrements the active entity count at 50220 and the total wave enemy count at Active_Enemy_Count. Initialises a dying-state colour timer via Initialise_Entity_State, writes a replacement Tick_Entity_Colour_Timer entity record at the same position, and scores 16 BCD points. Refreshes the colour bar via Clear_Colour_Bar_Column.
Kill_Tracked_Enemy_Entity 58553 LD DE,6 Step back six bytes to the entity position, erase the sprite via Erase_Narrow_Entity_Sprite, and restore HL.
58556 AND A
58557 SBC HL,DE
58559 PUSH HL
58560 CALL Erase_Narrow_Entity_Sprite
58563 POP HL Remove the entity from the list via Remove_Entity_From_List_Step and erase the spawn buffer via Erase_Wide_Entity_Sprite.
58564 CALL Remove_Entity_From_List_Step
58567 EXX Decrement the active count at 50220 and the wave enemy count at Active_Enemy_Count.
58568 LD HL,50449
58571 CALL Erase_Wide_Entity_Sprite
58574 LD HL,50220 Initialise a dying entity state via Initialise_Entity_State with code 2.
58577 DEC (HL)
58578 LD HL,50204
58581 DEC (HL) Write handler Tick_Entity_Colour_Timer at Entity_Pointer_Stash and set the entity timer to 50 frames.
58582 LD E,2
58584 CALL Initialise_Entity_State
58587 LD DE,58514
58590 LD HL,(50447)
58593 DEC HL Copy the entity Y and X position data and set the colour timer initial value.
58594 LD (HL),D
58595 DEC HL
58596 LD (HL),E
58597 INC HL
58598 INC HL
58599 LD (HL),50
58601 INC HL
58602 LD (HL),20 Point HL back to the Y position, set colour INK: WHITE, PAPER: BLACK (BRIGHT) in B', and draw via Draw_Entity_Sprite.
58604 INC HL
58605 LD D,H
58606 LD E,L
58607 INC DE
58608 LD A,(DE)
58609 LD (HL),A
58610 INC HL
58611 INC DE
58612 INC DE
58613 LD A,(DE)
58614 LD (HL),A
58615 DEC HL
58616 DEC HL
58617 EXX
58618 LD B,71
58620 EXX
58621 CALL Draw_Entity_Sprite
Update the player's BCD score by 16 points and propagate any carry through the higher-order score digits.
58624 LD HL,50181 Add 16 BCD to the units score at 50181 and propagate carry through two further score digits.
58627 LD A,(HL)
58628 ADD A,16
58630 DAA
58631 LD (HL),A
58632 JP NC,Kill_Tracked_Enemy_Score_Bar
58635 DEC HL
58636 LD A,(HL)
58637 ADD A,1
58639 DAA
58640 LD (HL),A
58641 JP NC,Kill_Tracked_Enemy_Score_Bar
58644 DEC HL
58645 LD A,(HL)
58646 ADD A,1
58648 DAA
58649 LD (HL),A
Kill_Tracked_Enemy_Score_Bar 58650 CALL Clear_Colour_Bar_Column Refresh the colour bar via Clear_Colour_Bar_Column and advance via Process_Tracked_Enemy_Entity_Reload.
58653 JP Process_Tracked_Enemy_Entity_Reload
Prev: 58535 Up: Map Next: 58656