Prev: CCC5 Up: Map Next: CCD6
CCC7: Do two objects overlap in Z?
Not centred like X and Y: Z is an object's base and +$06 its whole height. So the test takes the gap between the two bases and compares it with the height of whichever object is lower. The player's top half has a height of 0, which is why it is kept out of the scans while the legs move (player_move_and_draw): the legs, 23 high, would find it inside them.
Input
IX the moving object
IY the other object
H the mover's dZ
F carry set on exit if they overlap
do_objs_intersect_on_z CCC7 LD A,(IX+$03) A = Z + dZ - other Z
CCCA ADD A,H
CCCB SUB (IY+$03)
CCCE JP P,intersect_z_above we are the lower one: our height
CCD1 NEG
CCD3 LD D,(IX+$06)
Prev: CCC5 Up: Map Next: CCD6