Prev: C5BE Up: Map Next: C5E9
C5D3: Do two objects overlap in Z?
Not centred like U and V: Z is an object's base and +$06 its whole height. So the test takes the gap between the two bases, after the mover's dZ, and compares it with the height of whichever object is lower. The robot's top has no height while the legs move (PLAYER_LEGS), and is kept out of the scans then; the legs, 23 high meanwhile, stand for the whole robot. Also used by DO_ANY_OBJS_INTERSECT and CAN_PICK_UP.
Input
IX the moving object
IY the other object
H the mover's dZ
Output
F carry set if they overlap
DO_OBJS_INTERSECT_ON_Z C5D3 LD A,(IX+$03) A = Z + dZ - the other's Z; the mover higher, use the other's height
C5D6 ADD A,H
C5D7 SUB (IY+$03)
C5DA JP P,DO_OBJS_INTERSECT_ON_Z_1
C5DD NEG The mover lower: the distance, and its own height
C5DF LD D,(IX+$06)
DO_OBJS_INTERSECT_ON_Z_0 C5E2 SUB D Carry if the gap is less than the lower one's height
C5E3 RET
DO_OBJS_INTERSECT_ON_Z_1 C5E4 LD D,(IY+$06) The other's height
C5E7 JR DO_OBJS_INTERSECT_ON_Z_0
Prev: C5BE Up: Map Next: C5E9