Prev: C5C8 Up: Map Next: C5FD
C5DD: Give a ghost a new direction
Used by the routine at upd_80_to_83.
Each of dx and dy is taken from entries 4 to 7 of delta_tbl -- -3, +3, -4 or +4 -- one chosen by the random seed and the other by the frame counter. Then the sprite is chosen to match, and a sound played.
ghost_new_direction C5DD LD A,($5BA5) dx
C5E0 AND $03
C5E2 ADD A,$04
C5E4 CALL get_delta_from_tbl
C5E7 LD (IX+$09),A
C5EA LD A,($5BA2) dy
C5ED AND $03
C5EF ADD A,$04
C5F1 CALL get_delta_from_tbl
C5F4 LD (IX+$0A),A
C5F7 CALL calc_ghost_sprite face the way it is going
C5FA CALL sound_pitch_from_xyz the sound's pitch comes from x + y + z
Prev: C5C8 Up: Map Next: C5FD