Prev: 53043 Up: Map Next: 53156
53074: Step Wide Entity Approach
Per-entity frame handler for an approaching wide entity. Advances the scroll counter, moves the entity down by eight pixels per frame, and on the final frame installs Handle_Horizontal_Enemy_Entity as the entity's new handler. Called from Main_Game_Loop.
Step_Wide_Entity_Approach 53074 EX DE,HL Copy the entity pointer to DE.
53075 LD HL,(50485) Advance the animation phase counter by 64.
53078 LD BC,64
53081 ADD HL,BC
53082 LD (50485),HL
53085 EX DE,HL Copy the entity pointer back to HL.
53086 LD A,D Jump to Step_Wide_Entity_Approach_Wrap to wrap the approach at the screen boundary.
53087 CP 15
53089 JR Z,Step_Wide_Entity_Approach_Wrap
53091 JR NC,Step_Wide_Entity_Approach_Advance_Six Jump to Step_Wide_Entity_Approach_Advance_Six if the entity's approach descent is complete.
53093 EXX Load the entity draw colour.
53094 LD B,A
53095 INC B
53096 EXX
53097 PUSH HL Draw the entity sprite.
53098 CALL Draw_Wide_Entity_Sprite_Pixels_Only
53101 POP HL
53102 INC HL Move the entity eight pixels down the screen.
53103 LD A,(HL)
53104 ADD A,8
53106 LD (HL),A
53107 DEC HL Step back within the entity record.
53108 LD A,(50486) Skip spawning if this is not the final approach frame.
53111 CP 1
53113 JR NZ,Step_Wide_Entity_Approach_Draw
53115 EXX Switch to the entity arrival colour INK: GREEN, PAPER: BLACK (BRIGHT) .
53116 LD B,68
53118 EXX
53119 PUSH HL Draw the entity's arrival frame.
53120 CALL Draw_Wide_Entity_Sprite
53123 POP HL
53124 DEC HL Install Handle_Horizontal_Enemy_Entity as the entity handler to begin horizontal movement.
53125 LD DE,57782
53128 LD (HL),D
53129 DEC HL
53130 LD (HL),E
53131 LD DE,8 Advance eight bytes to the next entity record.
53134 JR Step_Wide_Entity_Approach_Advance
Step_Wide_Entity_Approach_Wrap 53136 INC HL Reset the descent position to wrap the approach path.
53137 LD A,(HL)
53138 SUB 112
53140 LD (HL),A
53141 DEC HL Step back and prepare the draw colour.
53142 LD A,D
Step_Wide_Entity_Approach_Draw 53143 EXX Load the draw colour.
53144 LD B,A
53145 EXX
53146 PUSH HL Draw the entity sprite.
53147 CALL Draw_Wide_Entity_Sprite_Pixels_Only
53150 POP HL
Step_Wide_Entity_Approach_Advance_Six 53151 LD DE,6 Prepare to advance past this entity record.
Step_Wide_Entity_Approach_Advance 53154 ADD HL,DE Advance to the next entity record and return.
53155 RET
Prev: 53043 Up: Map Next: 53156