I love the Pick Object Command but I needed Pick Sprite so here it is
Function Pick_Sprite(Target)
rem change 999 to any number you wish
rem move the next line outside of main loop should only be called once
get image 999,1,1,2,2
sprite 999,mousex(),Mousey(),999
hit = sprite collision(999,Target)
rem the following is only for testing
set cursor mousex()-200,Mousey()
print "Hit Sprite # : ",hit
EndFunction hit
If you use a specific sprite number as Target it will return "1" if cursor is over Target sprite
Pick_Sprite(Target)
If you use Pick_Sprite(0) it will return the number of the lowest sprite only (if multiple sprites overlap)
System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX