Prev: 50376 Up: Map Next: 50573
50540: 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 8, 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 50540 BIT 3,C Return if the jump key is not pressed.
50542 RET Z
50543 LD A,(IX+12) Fetch the collision flags.
50546 AND %11110000 Keep only the countdown from entering the room.
50548 RET NZ Return if the player has only just entered the room.
50549 BIT 3,(IX+12) Return if the player is already jumping.
50553 RET NZ
50554 BIT 2,(IX+12) Return if the player is not on the ground.
50558 RET Z
Start the jump and play the sound.
50559 SET 3,(IX+12) Flag that the player is jumping.
50563 LD (IX+11),8 Set the speed along z to 8.
50567 PUSH BC Stash the controls on the stack.
50568 CALL PlayJumpSound Call PlayJumpSound to make the sound of a jump.
50571 POP BC Restore the controls from the stack.
50572 RET Return.
Prev: 50376 Up: Map Next: 50573