Prev: 52430 Up: Map Next: 52499
52457: Process Enemy Entity
Used by the routine at Primary_Enemy_Entity_Handler.
Draws a wave enemy entity's sprite, updates its handler to the entity update completion routine, then checks for contact with the player. If the enemy touches the player, the entity is erased, removed from the list, the wave enemy count is decremented, and execution returns to the dispatcher.
Process_Enemy_Entity 52457 PUSH HL Stash the entity record pointer, advance four bytes to the screen address field, and draw the entity sprite via Draw_Spawned_Entity.
52458 INC HL
52459 INC HL
52460 INC HL
52461 INC HL
52462 CALL Draw_Spawned_Entity
52465 POP HL Restore the entity record pointer, step back to the handler field, and write the entity update completion address Advance_Entity_Pointer.
52466 DEC HL
52467 DEC HL
52468 LD DE,52499
52471 LD (HL),E
52472 INC HL
52473 LD (HL),D
52474 INC HL
52475 EXX Switch to alternate registers, subtract 6 from the entity list position to locate the record within the list.
52476 LD DE,6
52479 SBC HL,DE
52481 PUSH HL Stash the record position, erase the entity sprite via Erase_Narrow_Entity_Sprite, and restore the position.
52482 CALL Erase_Narrow_Entity_Sprite
52485 POP HL
52486 LD (50394),HL Save the record pointer to Entity_Record_Pointer and remove the entity from the list via Remove_Entity_From_List.
52489 CALL Remove_Entity_From_List
52492 LD HL,50211 Decrement the wave enemy count at Wave_Enemy_Count and set the entity colour to INK: WHITE, PAPER: BLACK (BRIGHT) in B'.
52495 DEC (HL)
52496 LD B,71
52498 EXX Return to the main register set.
Prev: 52430 Up: Map Next: 52499