Prev: E92C Up: Map Next: E9CC
E974: Kill Wall Bouncing Enemy
Used by the routine at Process_Wall_Bouncing_Enemy.
Reached when a wall-bouncing enemy makes contact with the player. Saves the entity position in Entity_Record_Pointer, erases the sprite via Erase_Narrow_Entity_Sprite, and removes the entity from the list via Remove_Entity_From_List. Decrements the wave enemy total at Active_Enemy_Count and the bouncing enemy count at Bouncing_Enemy_Count. Triggers the border colour effect via Initialise_Entity_State and awards 05 BCD points. Refreshes the colour bar, double-erases the sprite via Erase_Wide_Entity_Sprite and Draw_Wide_Entity_Sprite_Pixels_Only, writes the dying handler Animate_Wall_Bouncing_Enemy_Death into the record, and returns.
Save the entity position and remove the bouncer from the enemy list.
Kill_Wall_Bouncing_Enemy E974 LD DE,$0006 Step back six bytes to the entity position.
E977 SBC HL,DE
E979 LD ($C4DA),HL Save the entity position in Entity_Record_Pointer.
E97C CALL Erase_Narrow_Entity_Sprite Call Erase_Narrow_Entity_Sprite to erase the bouncer sprite.
E97F CALL Remove_Entity_From_List Call Remove_Entity_From_List to remove the bouncer from the entity list.
Decrement the wave enemy and bouncing enemy counts.
E982 LD HL,$C41C Decrement the wave enemy total at Active_Enemy_Count.
E985 DEC (HL)
E986 LD HL,$C42F Decrement the bouncing enemy count at Bouncing_Enemy_Count.
E989 DEC (HL)
Trigger the border colour flash and award five BCD points for the kill.
E98A LD E,$00 Call Initialise_Entity_State to trigger the border colour effect.
E98C CALL Initialise_Entity_State
E98F LD HL,$C405 Add 05 BCD points to the units score digit at C405.
E992 LD A,(HL)
E993 ADD A,$05
E995 DAA
E996 LD (HL),A
E997 JR NC,Kill_Wall_Bouncing_Enemy_Spawn
E999 DEC HL Propagate the BCD carry through the tens and hundreds score digits.
E99A LD A,(HL)
E99B ADD A,$01
E99D DAA
E99E LD (HL),A
E99F JR NC,Kill_Wall_Bouncing_Enemy_Spawn
E9A1 DEC HL
E9A2 LD A,(HL)
E9A3 ADD A,$01
E9A5 DAA
E9A6 LD (HL),A
Refresh the colour bar and set up the dying animation handler.
Kill_Wall_Bouncing_Enemy_Spawn E9A7 CALL Clear_Colour_Bar_Column Call Clear_Colour_Bar_Column to refresh the colour bar.
E9AA LD B,$02 Load RED into B.
E9AC EXX Switch to alternate registers.
E9AD DEC HL Step back to the entity position field.
E9AE LD ($C50F),HL Save the position pointer at Entity_Pointer_Stash.
E9B1 CALL Erase_Wide_Entity_Sprite Call Erase_Wide_Entity_Sprite to erase the sprite.
E9B4 LD HL,($C50F) Reload the position pointer from Entity_Pointer_Stash.
E9B7 CALL Draw_Wide_Entity_Sprite_Pixels_Only Call Draw_Wide_Entity_Sprite_Pixels_Only to XOR-erase the sprite.
E9BA LD HL,($C50F) Reload the position pointer from Entity_Pointer_Stash.
Install the dying animation handler and advance past the entity record.
E9BD DEC HL Step back and set the death timer to 02.
E9BE LD (HL),$02
E9C0 DEC HL Write the dying handler address Animate_Wall_Bouncing_Enemy_Death into the entity record.
E9C1 LD DE,$E9CC
E9C4 LD (HL),D
E9C5 DEC HL
E9C6 LD (HL),E
E9C7 LD DE,$0009 Step nine bytes forward to the next entity slot.
E9CA ADD HL,DE
E9CB RET Return.
Prev: E92C Up: Map Next: E9CC