Prev: C235 Up: Map Next: C25E
C23D: 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 The address of the object
Return unless a jump is allowed.
HandleJump C23D BIT 3,C Return if the jump control is not pressed.
C23F RET Z
C240 LD A,(IX+$0C) Fetch the collision flags.
C243 AND %11110000 Keep only bits 4-7.
C245 RET NZ Return if the player is entering the room.
C246 BIT 3,(IX+$0C) Return if the player is already jumping.
C24A RET NZ
C24B LD A,(IX+$0B) Fetch the speed along the z axis.
C24E INC A Increment A.
C24F RET M Return if the sign flag is set.
Start the jump.
C250 SET 3,(IX+$0C) Flag the player as jumping.
C254 LD (IX+$0B),$08 Set the speed along the z axis to 08.
C258 PUSH BC Stash BC on the stack.
C259 CALL PlayJumpSound Call PlayJumpSound.
C25C POP BC Restore BC from the stack.
C25D RET Return.
View the equivalent code in;
Prev: C235 Up: Map Next: C25E