make a small black box sprite and position it to your mouse hidden, then check if collision between the mouse collision sprite and level sprites are true.
Here's a basic example from a game im working on.
` checker for buttons
load image "mediamc.bmp",50
sprite 50,0,0,50
set sprite 50,1,1
offset sprite 50,3,3
hide sprite 50
`Loads the skeleton hand as the mouse
load image "mediamouse.bmp",51,1
sprite 51,0,0,51
offset sprite 51,18,5
scale sprite 51,50
set sprite priority 51,1
set sprite 51,1,1
show sprite 51
hide mouse
do
if sprite collision (50,204) and mouseclick() = 1 and openbox# = 1 and closedoor# = 1
hide sprite 1000
hide sprite 201
show sprite 200
play sound 101
mx# = mousex()
my# = mousey()
show sprite 261
wait 3000
hide sprite 261
show sprite 262
wait 3000
hide sprite 262
show sprite 1000
position mouse mx#,my#
endif
`closes the door when closed box is ticked and the door is pressed
if sprite collision (50,204) and mouseclick() = 1 and closebox# = 1 and opendoor# = 1
hide sprite 1000
mx# = mousex()
my# = mousey()
hide sprite 200
show sprite 201
play sound 102
show sprite 260
wait 3000
hide sprite 260
show sprite 1000
position mouse mx#,my#
endif
`Controls the mouse and the exit game button
`____________________________________________________________________
`Variables for putting the mouse collision box to the mouse positions
mx# = mousex()
my# = mousey()
`Puts the sprite mouse collision onto the mouse position
sprite 50,mx#,my#,50
sprite 51,mx#,my#,51
`Exit Box collision check to end the game
if sprite collision (50,1000) and mouseclick()=1
end
endif
loop