Prev: 817C Up: Map Next: 81F0
81DB: Handle Axe
The handler for a thrown axe, which has the sprite IDs 40 to 47. Picks the animation frame from FRAMES, sets the attribute and then runs the movement code that is shared by all of the weapons at HandlerWeapon.
Input
IX The weapon entity
HandlerAxe 81DB CALL StoreEntity Call StoreEntity to save the position of the weapon.
81DE LD A,($5C78) Fetch FRAMES.
81E1 CPL Invert the bits.
81E2 RRA Rotate A right (the frame changes on every other tick).
81E3 AND %00000111 Keep only bits 0-2 (there are 8 animation frames).
81E5 ADD A,$40 Add 40 to point to the correct frame/ sprite ID (the axe base sprite ID is: 40).
81E7 LD (IX+$00),A Write the new frame/ sprite ID back to the entity.
81EA LD (IX+$05),$42 Set the attribute of the axe to INK:RED, PAPER:BLACK (BRIGHT).
81EE JR HandlerWeapon Jump to HandlerWeapon to move the weapon.
Prev: 817C Up: Map Next: 81F0