Do
Rem checking mouse click
if mouseclick()=1 then gosub zonecheck
loop
Rem Zones are invisible rectangles that detect an event.
Rem The could be used to pick up objects, or to check whether
Rem a sprite has walked through a doorway.
ZoneCheck:
REM area 0
if zoneclicked(44,18,164,78)=1
endif
REM area 1
if zoneclicked(45,83,164,140)=1 and stage >1
endif
Return
Rem This checks the mouse x/y, but it could be used with a sprite's x/y
function ZoneClicked(X1,Y1,X2,Y2)
J=0:X=mousex():Y=mousey()
if X>=X1 and X<=X2 and Y>=Y1 and Y<=Y2 then J=1
endfunction J
Sprite collision could be used as well. Collision with the mouse cursor is another way to pick up objects, and walk to doorways. Actually that might be better.