Prev: CBA0 Up: Map Next: CBD9
CBAF: Shorten dX: does the move hit it?
Used by the routine at dX_obj_shorten.
If the boxes would overlap in X too, the move is stopped (bit 0 of +$0C) and harm passes. Bit 6 of +$0D means "has been harmed": the obstacle gets it if the mover has bit 7 (harms what it runs into), and the mover gets it if the obstacle has bit 5 (harms what runs into it). This is how the player dies of a guard or of spikes: upd_player_bottom watches bit 6.
dX_obj_hit_test CBAF CALL do_objs_intersect_on_x no overlap in X: next object
CBB2 JR NC,dX_obj_next
CBB4 SET 0,(IX+$0C) stopped in X
CBB8 LD A,(IX+$0D) mover's bit 7 becomes the obstacle's bit 6
CBBB RRCA
CBBC AND $40
CBBE OR (IY+$0D)
CBC1 LD (IY+$0D),A
CBC4 RLCA obstacle's bit 5 becomes the mover's bit 6
CBC5 AND $40
CBC7 OR (IX+$0D)
CBCA LD (IX+$0D),A
CBCD BIT 2,(IY+$07) a pushable obstacle takes on our dX
CBD1 JR Z,dX_obj_shorten
CBD3 LD A,(IX+$09)
CBD6 LD (IY+$09),A
Prev: CBA0 Up: Map Next: CBD9