Prev: C1A1 Up: Map Next: C1F1
C1AB: 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 C1AB CALL SetPixelAdjustments Set the pixel adjustments of an extra life.
C1AE PUSH IX Copy IX to IY (using the stack).
C1B0 POP IY
C1B2 LD IX,$5C08 Point IX at ObjectsTable.
C1B6 INC (IX+$04) Make the player wider by one.
C1B9 INC (IX+$05) Make the player deeper by one.
C1BC CALL TestNearObject Test whether the player is on or next to the extra life.
C1BF DEC (IX+$04) Put the width of the player right.
C1C2 DEC (IX+$05) Put the depth of the player right.
C1C5 PUSH IY Copy IY to IX (using the stack).
C1C7 POP IX
C1C9 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.
C1CB SET 3,(IX+$00) Change the graphic of the object to the one that removes it.
C1CF CALL SetPixelAdjustments_Sparkle Set the pixel adjustments of a sparkle.
C1D2 LD L,(IX+$10) Fetch the low byte of the address of the table entry that the object comes from.
C1D5 LD H,(IX+$11) Fetch the high byte.
C1D8 LD (HL),$00 Clear the graphic number of the table entry.
C1DA LD HL,$5BBA Point HL at Lives.
C1DD INC (HL) Give the player an extra life.
C1DE XOR A Clear A.
C1DF LD ($5BC0),A Allow the spiked balls to drop again at SpikedBallHoldFlag.
C1E2 CALL PlayLowBeep Play a beep.
C1E5 CALL PrintLives Print the number of lives.
C1E8 LD BC,$2020 Set the position of the number of lives on the panel.
C1EB CALL CopyAreaToScreen Copy the number of lives from the screen buffer to the display.
HandleExtraLife_Update C1EE JP HandleTable_Fall Update the object, making it move if it has to.
Prev: C1A1 Up: Map Next: C1F1