Prev: CC95 Up: Map Next: CCB0
CC9D: Do two objects overlap in X?
Boxes are centred on X and Y, with +$04 and +$05 the half-sizes. They overlap in X if the distance between the centres, after the mover's dX, is less than the two half-widths added: exactly touching is not overlapping. Also used by overlap_test_obj and is_on_or_near_obj.
Input
IX the moving object
IY the other object
C the mover's dX
F carry set on exit if they overlap
do_objs_intersect_on_x CC9D LD A,(IX+$04) D = the two half-widths
CCA0 ADD A,(IY+$04)
CCA3 LD D,A
CCA4 LD A,(IX+$01) A = |X + dX - other X|
CCA7 ADD A,C
CCA8 SUB (IY+$01)
CCAB JP P,intersect_x_result
CCAE NEG
Prev: CC95 Up: Map Next: CCB0