Prev: 90CC Up: Map Next: 9117
90FB: Check Player Touching
Used by the routines at HandlerFoodItem, HandlerPickupItem and HandlerMushroom.
Checks whether the player is touching an entity. The player is touching it when it is less than 0C pixels away on both axes.
Input
IX The entity
Output
F The carry flag is set if the player is touching the entity
CheckPlayerTouching 90FB LD A,($EA93) Fetch the X position of the player from EA93.
90FE SUB (IX+$03) Subtract the X position of the entity.
9101 JP P,CheckPlayerTouching_X Jump to CheckPlayerTouching_X if the result is positive.
9104 NEG Make the result positive.
CheckPlayerTouching_X 9106 CP $0C Return if the player is too far away on the X axis.
9108 RET NC
9109 LD A,($EA94) Fetch the Y position of the player from EA94.
910C SUB (IX+$04) Subtract the Y position of the entity.
910F JP P,CheckPlayerTouching_Y Jump to CheckPlayerTouching_Y if the result is positive.
9112 NEG Make the result positive.
CheckPlayerTouching_Y 9114 CP $0C Compare it with 0C.
9116 RET Return.
Prev: 90CC Up: Map Next: 9117