Prev: 55079 Up: Map Next: 55148
55116: Update Health Bonus
The routine for objects of type 3, the bonuses that restore the player's health. A bonus vanishes when the player is more than four cells away. When the player touches it, the bonus turns into a burst and the player's health is made full.
Vanish if the player is too far away.
UpdateHealthBonus 55116 LD C,4 Set the distance to 4 cells and check whether the bonus is that close to the player.
55118 CALL CheckPlayerClose
55121 JR C,UpdateHealthBonus_Close Jump to UpdateHealthBonus_Close if it is.
55123 LD (IX+0),0 Remove the bonus, because the player is too far away, and return.
55127 RET
Restore the player's health when the bonus is touched.
UpdateHealthBonus_Close 55128 CALL CheckPlayerCollision Return if the bonus is not touching the player.
55131 RET NC
55132 LD (IX+0),12 Turn the bonus into a burst.
55136 LD A,3 Give the player full health.
55138 LD (48115),A
55141 LD HL,519 Start the health bonus sound, which is sound effect 2 and has seven notes.
55144 LD (48121),HL
55147 RET Return.
Prev: 55079 Up: Map Next: 55148