Prev: C4C8 Up: Map Next: C58D
C56C: Handle Jump
Used by the routine at HandlePlayerLegs.
Starts a jump, if the jump key is pressed and the player is standing on the ground and was not already jumping. The jump is started by giving the player an upward speed of 08, which is cut down by gravity in MovePlayer.
Input
C Controls
IX Record of the legs
Return unless the player can start a jump.
HandleJump C56C BIT 3,C Return if the jump key is not pressed.
C56E RET Z
C56F LD A,(IX+$0C) Fetch the collision flags.
C572 AND %11110000 Keep only the countdown from entering the room.
C574 RET NZ Return if the player has only just entered the room.
C575 BIT 3,(IX+$0C) Return if the player is already jumping.
C579 RET NZ
C57A BIT 2,(IX+$0C) Return if the player is not on the ground.
C57E RET Z
Start the jump and play the sound.
C57F SET 3,(IX+$0C) Flag that the player is jumping.
C583 LD (IX+$0B),$08 Set the speed along z to 08.
C587 PUSH BC Stash the controls on the stack.
C588 CALL PlayJumpSound Call PlayJumpSound to make the sound of a jump.
C58B POP BC Restore the controls from the stack.
C58C RET Return.
Prev: C4C8 Up: Map Next: C58D