Prev: B8B7 Up: Map Next: B8E2
B8CC: 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.
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 B8CC LD A,(IX+$03) A = Z + dZ - the other's Z; the mover higher, use the other's height
B8CF ADD A,H
B8D0 SUB (IY+$03)
B8D3 JP P,DO_OBJS_INTERSECT_ON_Z_1
B8D6 NEG the mover lower: the distance, and its own height
B8D8 LD D,(IX+$06)
DO_OBJS_INTERSECT_ON_Z_0 B8DB SUB D carry if the gap is less than the lower one's height
B8DC RET
DO_OBJS_INTERSECT_ON_Z_1 B8DD LD D,(IY+$06) the other's height
B8E0 JR DO_OBJS_INTERSECT_ON_Z_0
Prev: B8B7 Up: Map Next: B8E2