Prev: C940 Up: Map Next: C969
C948: Start a jump
Used by the routine at player_controls.
Jump starts only when the jump control is held, the room-entry walk is over, no jump is already in progress (bit 3 of +$0C, cleared on landing by move_player_apply), and the player is not already falling. The launch speed is 8 units up; apply_gravity then takes it away again frame by frame.
The test is on the speed, not on standing: a dZ of -1 or more is enough, and the collision code leaves dZ at 0 for a player on the ground.
Input
C the controls
handle_jump C948 BIT 3,C jump not held
C94A RET Z
C94B LD A,(IX+$0C) not during the room-entry walk
C94E AND $F0
C950 RET NZ
C951 BIT 3,(IX+$0C) not while a jump is in progress
C955 RET NZ
C956 LD A,(IX+$0B) dZ -2 or less: already falling
C959 INC A
C95A RET M
C95B SET 3,(IX+$0C) jumping, 8 units a frame upwards
C95F LD (IX+$0B),$08
C963 PUSH BC the jump sound; C, the controls, kept
C964 CALL sound_jump
C967 POP BC
C968 RET
Prev: C940 Up: Map Next: C969