Prev: F1DA Up: Map Next: F251
F1DE: Room Event : Axe
Used by the routine at Update_Room00.
Input
Output
Handler_BouncingAxe F1DE LD A,(Flag_BaddyInit) Has axe been intiialised yet?
F1E1 OR A
F1E2 JR NZ,Handler_BouncingAxe_0
Initialise
F1E4 LD HL,$3A64
F1E7 LD (Axe_Position),HL
F1EA LD (BitmapX),HL
F1ED LD A,$04
F1EF LD (Axe_VelocityY),A
F1F2 LD A,(Axe_Bitmap)
F1F5 CALL Bitmap16Draw
F1F8 LD A,$01
F1FA LD (Flag_BaddyInit),A
F1FD RET
Animate
Handler_BouncingAxe_0 F1FE LD HL,(Axe_Position)
F201 LD (BitmapX),HL
F204 LD A,(Axe_VelocityY) Move Y in direction and speed of velocity.
F207 LD D,A
F208 LD A,H
F209 ADD A,D
F20A LD H,A
F20B CP $A8 check for hitting the floor.
F20D JR C,Handler_BouncingAxe_2
Handler_BouncingAxe_1 F20F LD A,D Change direction of the Y velocity.
F210 NEG
F212 LD D,A
F213 CALL Sound_AxeBounce
F216 JR Handler_BouncingAxe_3
Handler_BouncingAxe_2 F218 CP $38 Check for hitting the ceiling.
F21A JR C,Handler_BouncingAxe_1
Handler_BouncingAxe_3 F21C LD A,(Axe_Bitmap) Erase axe.
F21F CALL Bitmap16Draw
F222 INC L Move along X axis.
F223 LD A,L Check for wrap around the room.
F224 CP $E8
F226 JR C,Handler_BouncingAxe_4
F228 LD HL,$9808 Reset position to the left hand side.
F22B LD D,$FC
Handler_BouncingAxe_4 F22D LD (BitmapX),HL Update position.
F230 LD (Axe_Position),HL
F233 LD A,D Update velocity, in case it changed.
F234 LD (Axe_VelocityY),A
F237 LD A,(Axe_Bitmap) Animate every even move.
F23A BIT 0,L
F23C JR Z,Handler_BouncingAxe_6
F23E INC A
F23F CP $BB
F241 JR NZ,Handler_BouncingAxe_5
F243 LD A,$B3 Reset to first frame again.
Handler_BouncingAxe_5 F245 LD (Axe_Bitmap),A Update and draw.
Handler_BouncingAxe_6 F248 CALL Bitmap16Draw
F24B LD B,$05 Check if hit Wally, if so remove 5 points from energy.
F24D CALL Wally_HitTest
F250 RET
Prev: F1DA Up: Map Next: F251