Prev: C657 Up: Map Next: C71C
C6E4: The robot's top (graphics 32 to 43)
The top has no movement of its own. Each turn it copies the legs' U, V, Z, half-sizes, height and flags, takes a height one less, sits 12 above the legs, and takes the legs' graphic plus 16 -- so it turns and steps with them: legs 16-23 and 24-27, top 32-39 and 40-43. Then it and whatever its old or new rectangle meets are marked to be drawn (SET_DRAW_OBJS_OVERLAPPED). The flags it copies carry the legs' mirror bit, and their draw bits, which the legs' update has just set (SET_WIPE_AND_DRAW_FLAGS).
The legs' height is 12 by now (the tail of PLAYER_LEGS), so the top's is 11, from 12 up to 23: the robot's box is 23 high in all, the height the legs take on their own while he moves. Unlike Pentagram's body, the top is kept out of the collision tests only while the legs move (PLAYER_LEGS sets bit 1 of its flags around the move), so other things can land on it and meet it.
A top marked killed (bit 6 of +$0D) marks the legs killed too and turns into the sparkle he dies in (START_SPARKLE); the legs' update does the same the other way.
Input
IX the top's record
TOP_FOLLOWS_LEGS C6E4 CALL DRAW_AT_L16_D3 Drawn 16 left and 3 down
C6E7 BIT 6,(IX+$0D) Killed?
C6EB JR Z,TOP_FOLLOWS_LEGS_0
C6ED SET 6,(IX-$13) Then the legs are too; become the sparkle
C6F1 JP START_SPARKLE
TOP_FOLLOWS_LEGS_0 C6F4 PUSH IX IY = HL = the legs, the record below (-32)
C6F6 POP DE
C6F7 LD HL,$FFE0
C6FA ADD HL,DE
C6FB PUSH HL
C6FC POP IY
C6FE INC DE U, V, Z, the half-sizes, the height and the flags from the legs
C6FF INC HL
C700 LD BC,$0007
C703 LDIR
C705 DEC (IX+$06) One less high
C708 LD A,(IY+$00) The legs' graphic plus 16
C70B ADD A,$10
C70D LD (IX+$00),A
C710 LD A,(IY+$03) 12 above the legs
C713 ADD A,$0C
C715 LD (IX+$03),A
C718 CALL SET_DRAW_OBJS_OVERLAPPED Have it and whatever it overlaps redrawn
C71B RET
Prev: C657 Up: Map Next: C71C