Prev: 74A7 Up: Map Next: 74D6
74B9: Animate Stunned Hazard
Animates the stunned hazard sequence. Used by the helicopter, cat, paratrooper, canopy and other hazards when hit by Percy's egg. Increments the animation counter until it reaches 85 cycling through animation frames. Assigns a random colour attribute and plays a hit sound each frame.
Input
IX Pointer to hazard sprite data
IY Pointer to hazard state data
Animate_Stunned_Hazard 74B9 LD A,(IY+$00) Return if the animation counter at *IY+00 has reached 85 (animation complete).
74BC CP $85
74BE RET Z
74BF INC A Increment the animation counter and write it back to *IY+00.
74C0 LD (IY+$00),A
74C3 AND %01111111 Mask off bit 7, rotate right and add 36 to calculate the animation frame ID.
74C5 RRCA
74C6 ADD A,$36
74C8 LD (IX+$03),A Write the frame ID to *IX+03.
74CB CALL Generate_Random_Number Generate a random number and mask with 07 to produce a random colour attribute.
74CE AND %00000111
74D0 LD (IX+$02),A Write the colour attribute to *IX+02.
74D3 JP PlayHitSound Jump to PlayHitSound.
Prev: 74A7 Up: Map Next: 74D6