Prev: B5FF Up: Map Next: B63C
B626: Bouncing ball: set the chase direction and the bounce height
Used by the routine at upd_182_183.
Writes the opcode chosen in upd_182_183 into the two conditional jumps at bounce_ball_y_sense and bounce_ball_x_sense. With JR C a ball flees the player; with JR NC it chases him.
Then works out how hard it will bounce: a dZ of 4 in an even-numbered room, and 4 plus a random 0 to 3 in an odd-numbered one.
Input
A $30 or $38, the JR opcode
bounce_ball_set_sense B626 LD (bounce_ball_y_sense),A patch both jumps
B629 LD (bounce_ball_x_sense),A
B62C LD A,($5C10) even room: bounce with dZ 4
B62F AND $01
B631 LD A,$04
B633 JR Z,bounce_ball_on_landing
B635 LD B,A odd room: 4 to 7
B636 LD A,($5BA5)
B639 AND $03
B63B ADD A,B
Prev: B5FF Up: Map Next: B63C