Prev: 49569 Up: Map Next: 49649
49579: Handle Extra Life
Handles an extra life, which is an object that the player gets by touching it. When it is touched the object turns into the graphic that removes it, the table entry that it came from is cleared so that the object does not come back, and the player gets an extra life.
Input
IX Address of the extra life object
Test whether the player is touching the extra life.
HandleExtraLife 49579 CALL SetPixelAdjustments Set the pixel adjustments of an extra life.
49582 PUSH IX Copy IX to IY (using the stack).
49584 POP IY
49586 LD IX,23560 Point IX at ObjectsTable.
49590 INC (IX+4) Make the player wider by one.
49593 INC (IX+5) Make the player deeper by one.
49596 CALL TestNearObject Test whether the player is on or next to the extra life.
49599 DEC (IX+4) Put the width of the player right.
49602 DEC (IX+5) Put the depth of the player right.
49605 PUSH IY Copy IY to IX (using the stack).
49607 POP IX
49609 JR NC,HandleExtraLife_Update Jump to HandleExtraLife_Update if the player is not touching the extra life.
Award the extra life and remove the object.
49611 SET 3,(IX+0) Change the graphic of the object to the one that removes it.
49615 CALL SetPixelAdjustments_Sparkle Set the pixel adjustments of a sparkle.
49618 LD L,(IX+16) Fetch the low byte of the address of the table entry that the object comes from.
49621 LD H,(IX+17) Fetch the high byte.
49624 LD (HL),0 Clear the graphic number of the table entry.
49626 LD HL,23482 Point HL at Lives.
49629 INC (HL) Give the player an extra life.
49630 XOR A Clear A.
49631 LD (23488),A Allow the spiked balls to drop again at SpikedBallHoldFlag.
49634 CALL PlayLowBeep Play a beep.
49637 CALL PrintLives Print the number of lives.
49640 LD BC,8224 Set the position of the number of lives on the panel.
49643 CALL CopyAreaToScreen Copy the number of lives from the screen buffer to the display.
HandleExtraLife_Update 49646 JP HandleTable_Fall Update the object, making it move if it has to.
Prev: 49569 Up: Map Next: 49649