Prev: BED6 Up: Map Next: BF2F
BEE0: The update routine for an extra life (graphic 12)
Reached through UPDATES. A place given graphic 12 at a new game (INIT_SPECIAL_OBJECTS) is an extra life, put in one of the two place records as its room is built (FIND_SPECIAL_OBJS_HERE). If the robot's legs touch it -- their box widened by 1 in U and V -- it becomes graphic 64, the first of a two-frame vanish (SPARKLE_STEP, SPARKLE_END_PLACE), its place is emptied so it never comes back, the drop latch is cleared, and LIVES goes up by one, is reprinted on the panel and copied to the screen. Either way it then falls and settles like other things. As Knight Lore's upd_103, the extra life, but through the table of places rather than Knight Lore's special-object table.
Input
IX the extra life's record
EXTRA_LIFE BEE0 CALL DRAW_AT_L8_D2 the drawing nudge: X -8, Y -2
BEE3 PUSH IX IY = the extra life; IX = the robot's legs
BEE5 POP IY
BEE7 LD IX,OBJECTS
BEEB INC (IX+$04) touching, with the legs 1 wider in U and V? The legs back as they were, and IX back
BEEE INC (IX+$05)
BEF1 CALL IS_ON_OR_NEAR_OBJ
BEF4 DEC (IX+$04)
BEF7 DEC (IX+$05)
BEFA PUSH IY
BEFC POP IX
BEFE JR NC,EXTRA_LIFE_FALL
BF00 LD (IX+$00),$40 graphic 64, the vanish, with its drawing nudge
BF04 CALL DRAW_AT_L12_D4
BF07 LD L,(IX+$10) its place emptied for good
BF0A LD H,(IX+$11)
BF0D XOR A
BF0E LD (HL),A
BF0F LD (DROP_LATCH),A the things on the ceiling may drop again
BF12 LD HL,LIVES one more life
BF15 INC (HL)
BF16 CALL PLAIN_BEEP beep, print the lives into the buffer and copy them to the screen, at pixel x 128, y 0 (BLIT_2X8)
BF19 CALL PRINT_LIVES
BF1C LD BC,$0080
BF1F CALL BLIT_2X8
EXTRA_LIFE_FALL BF22 CALL DEC_DZ_AND_UPDATE_UVZ fall and move; not moving: done
BF25 CALL IS_OBJ_MOVING
BF28 RET Z
BF29 CALL CLEAR_DUV moving: no step in U or V next turn; a sound and a redraw (SPARKLE_END_PLACE)
BF2C JP SOUND_AND_DRAW
Prev: BED6 Up: Map Next: BF2F