Prev: 89D4 Up: Map Next: 8AC4
8A63: Make Monty jump
Used by the routine at 89D4.
8A63 LD A,($848F) Get the position off the ground.
8A66 LD HL,($8492) Get the current pointer to the jump table.
8A69 CP $03
8A6B JR NZ,$8ACA
8A6D LD A,($5C7B) Decrease the X co-ordinate.
8A70 DEC A
8A71 LD ($5C7B),A
8A74 LD A,($5C7C) Add the scaling factor to the Y co-ordinate.
8A77 ADD A,(HL)
8A78 LD ($5C7C),A
8A7B LD DE,($8494) Get the next pitch to beep at when jumping.
8A7F BIT 7,(HL) Is the next direction moving upwards?
8A81 JR NZ,$8A8A Jump forward if not.
8A83 INC E Increase the pitch, so the jump effect increases while Monty is moving upwards.
8A84 LD ($8494),DE
8A88 JR $8A93
8A8A DEC E Otherwise decrease the pitch.
8A8B SET 7,(IX+$01) Set the falling flag.
8A8F LD ($8494),DE Set the new pitch.
8A93 INC HL Move to the next position in the jump table.
8A94 LD ($8492),HL
8A97 CALL $8AD3 Update Monty in this jump cycle.
8A9A LD A,($8498) Increment the jump time until it reaches 1F then reset back to 0.
8A9D INC A
8A9E AND $1F
8AA0 LD ($8498),A
8AA3 OR A Has the jump finished?
8AA4 JP NZ,$8B34 No, so check Monty's movement.
8AA7 LD ($848F),A Reset the position off the ground.
8AAA LD ($8D58),A Reset the distance fallen by.
8AAD LD HL,$869C Reset the pointer to the movement table to 869C.
8AB0 LD ($8492),HL
8AB3 LD HL,($8496) Reset the jump beep pitch back to the default.
8AB6 LD ($8494),HL
8AB9 RES 1,(IX+$00) Reset the jump flag.
8ABD RES 7,(IX+$01) Reset the falling flag.
8AC1 JP $8B34 Jump forward to set movement restrictions.
Prev: 89D4 Up: Map Next: 8AC4