Prev: C5BD Up: Map Next: C61D
C5D3: The player's update routine: body
The body (graphics 40 to 47) has no movement of its own: each turn it copies the legs' position, half-sizes and flags, takes a height of zero and sets bit 1 of its flags, which keeps it out of every collision test -- the legs' box is the whole player's. Its graphic is the legs' plus 8, the same facing and frame, and it sits 12 above the legs when seen from behind (facings 0 and 2) and 8 above when seen from the front.
Bits 0-3 of the body's +$0D are a count that would hold its own graphic for that many turns. Knight Lore sets it when it gives the head a random other frame; no code was found in Pentagram that sets it for the body, and the count never ran in the build's sessions.
A body marked killed (bit 6 of +$0D, set by PLAYER_LEGS when the legs are) turns into the puff instead (START_PUFF).
Input
IX The body's record (PLAYER_BODY)
PLAYER_TOP C5D3 CALL DRAW_AT_L12_D8 Drawn 12 left and 8 down
C5D6 BIT 6,(IX+$0D) Killed: become the puff
C5DA JP NZ,START_PUFF
C5DD PUSH IX IY = HL = the legs, the record below
C5DF POP DE
C5E0 LD HL,$FFE0
C5E3 ADD HL,DE
C5E4 PUSH HL
C5E5 POP IY
C5E7 INC DE U, V, Z, the half-sizes and the flags from the legs
C5E8 INC HL
C5E9 LD BC,$0007
C5EC LDIR
C5EE LD (IX+$06),$00 Height 0
C5F2 SET 1,(IX+$07) Bit 1: out of the collision tests
C5F6 LD A,(IX+$0D) The count running?
C5F9 AND $0F
C5FB JR Z,PLAYER_TOP_0
C5FD DEC (IX+$0D) Yes: count it down and keep the graphic
C600 JR PLAYER_TOP_1
PLAYER_TOP_0 C602 LD A,(IY+$00) Otherwise the legs' graphic plus 8
C605 ADD A,$08
C607 LD (IX+$00),A
PLAYER_TOP_1 C60A LD A,(IY+$00) Z: the legs' plus 12 for the view from behind (bit 2 clear), plus 8 for the front
C60D AND $04
C60F XOR $04
C611 ADD A,$08
C613 ADD A,(IY+$03)
C616 LD (IX+$03),A
C619 CALL SET_DRAW_OBJS_OVERLAPPED Have it and whatever it overlaps redrawn (SET_DRAW_OBJS_OVERLAPPED)
C61C RET
Prev: C5BD Up: Map Next: C61D