Prev: C5B7 Up: Map Next: C5DD
C5C8: A ghost (types 80 to 83)
A ghost drifts diagonally at a speed of 3 or 4 in each direction, and picks a new random diagonal whenever it has no speed (as when it has just been created) or runs into something across the floor. It animates on every frame and is deadly both ways: to what it runs into, and to what runs into it.
Input
IX the ghost's record
upd_80_to_83 C5C8 CALL adj_m6_m12 draw 12 left and 6 down
C5CB CALL dec_dZ_and_update_XYZ gravity, then move
C5CE LD A,(IX+$09) not moving: new direction
C5D1 OR (IX+$0A)
C5D4 JR Z,ghost_new_direction
C5D6 LD A,(IX+$0C) blocked in x or y (bits 0 and 1 of +$0C): new direction
C5D9 AND $03
C5DB JR Z,ghost_animate
Prev: C5B7 Up: Map Next: C5DD