Prev: C89F Up: Map Next: C969
C948: Handle Jump
Used by the routine at HandlePlayerLegs.
Makes the player jump if the jump control is pressed. The player cannot jump while entering a room, while already jumping, or while falling quickly.
Input
C The controls
IX Address of the object
Start a jump if the control is pressed and the player is ready.
HandleJump C948 BIT 3,C Test the jump control.
C94A RET Z Return if it is not pressed.
C94B LD A,(IX+$0C) Fetch the flags of the player.
C94E AND %11110000 Keep the counter of the player entering the room.
C950 RET NZ Return if the player is entering the room.
C951 BIT 3,(IX+$0C) Test whether the player is already jumping.
C955 RET NZ Return if it is.
C956 LD A,(IX+$0B) Fetch the speed in Z and add one to it.
C959 INC A
C95A RET M Return if it was lower than FF, as the player is falling.
C95B SET 3,(IX+$0C) Flag the player as jumping.
C95F LD (IX+$0B),$08 Set the speed in Z to 08.
C963 PUSH BC Stash the controls on the stack.
C964 CALL PlayJumpSound Play the sound of a jump.
C967 POP BC Restore the controls from the stack.
C968 RET Return.
View the equivalent code in;
Prev: C89F Up: Map Next: C969