Prev: 6B18 Up: Map Next: 6BAF
6B8B: Handle Falling Charlie
The handler for Charlie as he falls (ID 0E), after his hat has gone (see HandleHat). Charlie falls one pixel at a time until his vertical co-ordinate reaches B4. Then the actor ID is changed to 18 which is handled by HandleEndOfLife, and the tune for losing a life is played (unless the tunes are muted).
Input
IX Actor
HandleFallingCharlie 6B8B CALL StoreEntity Record the position of the sprite using StoreEntity.
6B8E LD A,(IX+$02) Fetch the vertical co-ordinate.
6B91 ADD A,$01 Add 01 to make Charlie fall by one pixel.
6B93 CP $B4 Jump to HandleFallingCharlie_Finished if Charlie has fallen far enough.
6B95 JR NC,HandleFallingCharlie_Finished
6B97 LD (IX+$02),A Update the vertical co-ordinate.
6B9A CALL DisplayEntity Erase the sprite and draw it in its new position using DisplayEntity.
6B9D JP ColourSprite Jump to ColourSprite to colour the sprite.
HandleFallingCharlie_Finished 6BA0 LD (IX+$00),$18 Write 18 to the actor ID.
6BA4 LD A,($5F0D) Fetch the sound mute flag.
6BA7 AND A Are the tunes muted?
6BA8 RET NZ Return if they are.
6BA9 LD DE,$65D1 Point DE at the tune for losing a life (MusicData_LoseLife).
6BAC JP PlayMusic Jump to PlayMusic to play the tune.
Prev: 6B18 Up: Map Next: 6BAF