Prev: 51240 Up: Map Next: 51309
51243: Handle Player Legs
Used by the routine at HandleHumanLegs.
Does all of the work for the player, as the top half of the player is only a copy of the bottom half placed above it (see HandleHumanTop). If the player has been killed this starts the death sparkles. Otherwise it reads the controls, lets the player pick up or drop an object, turn, jump and walk, and then moves the player.
Input
IX Address of the object
HandlePlayerLegs 51243 BIT 6,(IX+13) Jump to HandlePlayerLegs_Alive if the player is alive.
51247 JR Z,HandlePlayerLegs_Alive
51249 LD A,(23491) Fetch the final animation flag from FinalAnimationFlag.
51252 AND A
51253 JR NZ,HandlePlayerLegs_Alive Jump to HandlePlayerLegs_Alive if it is set, as the player is not killed during the final animation.
51255 SET 6,(IX+45) Flag the top half of the player as dead too.
51259 JP StartDeathSparkles Start the death sparkles.
The player is alive. The controls are kept in C while they are handled.
HandlePlayerLegs_Alive 51262 CALL StartTransformation Start the transformation if it is due. If it does start, this does not return here but to the routine that called this one.
51265 CALL ReadControls Read the controls.
51268 CALL HandlePickupAndDrop Handle picking up and dropping an object.
51271 CALL HandleTurning Handle turning.
51274 CALL HandleJump Handle jumping.
51277 CALL HandleWalking Handle walking.
51280 CALL TestPlayerInRoom Test whether the player is inside the room.
51283 JR NC,HandlePlayerOutsideRoom Jump to HandlePlayerOutsideRoom if the player is not.
This entry point is used by the routine at HandlePlayerOutsideRoom.
The top half of the player is flagged to be ignored in the 3D calculations while the player moves, so that the two halves do not get in each other's way.
HandlePlayerLegs_Move 51285 SET 1,(IX+39) Flag the top half of the player to be ignored.
51289 CALL MovePlayer Move the player.
51292 RES 1,(IX+39) Stop ignoring the top half of the player.
51296 LD A,(IX+12) Fetch the flags, which hold the counter of the player entering the room in the high nibble.
51299 SUB 16 Take one off the counter.
51301 JR C,HandlePlayerLegs_Draw Jump to HandlePlayerLegs_Draw if the counter was already zero.
51303 LD (IX+12),A Store the new counter.
HandlePlayerLegs_Draw 51306 JP SetWipeAndDrawFlags Jump to SetWipeAndDrawFlags.
Prev: 51240 Up: Map Next: 51309