The mouseclick command returns the number of the button that has been clicked. What you need to do is determine which button the mouse is over when button 1 is clicked.
The easiest way to do this is to create a 1 pixel square sprite which you then test for collision with the image sprites you are using for your menu
REM Project: project X III
REM Created: 7/16/2006 8:58:48 PM
sync on
sync rate 0
gosub _load_media
gosub _load_screen
_load_media:
load image "media/new game button.bmp",1
load image "media/secrets button.bmp",2
load image "media/exit button.bmp",3
rem create image 1 pixel square
get image 4,0,0,1,1,1
return
_load_screen:
sprite 1,20,300,1
sprite 2,20,350,2
sprite 3,20,400,3
do
rem paste sprite at mouse position
sprite 4,mousex(),mousey(),4
sync
rem right here is the problem
if mouseclick()=1
if sprite hit(4,1)>0 then goto _new_game
if sprite hit(4,2)>0 then goto _secrets
if sprite hit(4,3)>0 then end
endif
loop
end
_new_game:
cls
sync
print "insert new game here"
sync
wait key
end
_secrets:
cls
sync
print "insert secrets here"
sync
wait key
end
You could use a select case statement on the sprite hit command
Select Sprite Hit(4,0)
case 1
goto _new_game
endcase
case 2
goto _secrets
endcase
case 3
end
endcase
endselect
personally I would use gosubs rather than gotos as well.
Hope this helps.
Cheers,
Cloggy