Prev: 81DB Up: Map Next: 8209
81F0: Handle Fireball
The handler for a fireball, which has the sprite IDs 34 to 37. Advances the animation frame and flickers the colour.
Input
IX The weapon entity
HandlerFireball 81F0 CALL StoreEntity Call StoreEntity to save the position of the weapon.
81F3 LD A,(IX+$00) Fetch the sprite ID of the fireball and add one, to move on to the next frame.
81F6 INC A
81F7 AND %00000011 Keep only bits 0-1 (there are 4 animation frames).
81F9 ADD A,$34 Add 34 to point to the correct frame/ sprite ID (the fireball base sprite ID is: 34).
81FB LD (IX+$00),A Write the new frame/ sprite ID back to the entity.
81FE LD A,($5C78) Fetch FRAMES.
8201 RLA Rotate A left, which moves bit 0 into bit 1.
8202 AND %00000010 Keep only bit 1.
8204 ADD A,$45 Add 45 to get an attribute of INK:CYAN, PAPER:BLACK (BRIGHT) or INK:WHITE, PAPER:BLACK (BRIGHT).
8206 LD (IX+$05),A Set the attribute of the fireball.
Continue on to HandlerWeapon.
Prev: 81DB Up: Map Next: 8209