Prev: C9CC Up: Map Next: C9F3
C9CD: Resolve and apply the move
Used by the routine at apply_gravity.
Stores the new dZ, and keeps a copy in $5BC1: the collision code will shorten dZ, and the copy is what says afterwards which way the player was trying to go. A fall faster than two units a frame has a sound pitched by the height.
Then adj_for_out_of_bounds shortens the move against the walls and the other objects, handle_exit_screen checks for a walk out of the room (and does not come back if there is one), and add_dXYZ adds what is left to the position. A move downwards that was stopped (bit 2 of +$0C) is a landing, and ends the jump.
move_player_apply C9CD DEC A the first unit
C9CE LD (IX+$0B),A new dZ, and the intended dZ in $5BC1
C9D1 LD ($5BC1),A
C9D4 ADD A,$02 falling faster than 2: the falling sound
C9D6 CALL M,sound_pitch_from_z
C9D9 CALL adj_for_out_of_bounds cut the move short where it must be
C9DC CALL handle_exit_screen out of the room?
C9DF CALL add_dXYZ X, Y, Z += dX, dY, dZ
C9E2 BIT 2,(IX+$0C) stopped while moving down?
C9E6 JR Z,clear_dX_dY
C9E8 LD A,($5BC1)
C9EB AND A
C9EC JP P,clear_dX_dY
C9EF RES 3,(IX+$0C) then landed: the jump is over
Prev: C9CC Up: Map Next: C9F3