Here is a text based mouseover menu, designed to not use synchronization.
rem run in 640x480 resolution
global Flag as integer
Flag = 1
cls 0xFFFFFFFF
do
select Flag
case 1:
Menu()
endcase
case 2:
PlayGame()
endcase
case 3:
exit
endcase
endselect
loop
end
function PlayGame()
cls
ink -1, 0
print "Playing Game"
endfunction
function Menu()
ink 0xFFFF0000, 0
line 320-50, 240-24, 320+50, 240-24
line 320-50, 240-50, 320+50, 240-50
line 320-50, 240-50, 320-50, 240+50
line 320+50, 240-50, 320+50, 240+50
line 320-50, 240+50, 320+51, 240+50
ink 0xFF00FF00, 0
box 320-49, 240-49, 320+50, 240-24
set text opaque
ink 0xFFFFFF00, 0xFF0000FF
text 296, 196, " MENU "
if MenuItem(35, 15, "Start Game")
Flag = 2
endif
if MenuItem(35, 16, "End Game")
Flag = 3
endif
endfunction
function MenuItem(xPos as integer, yPos as integer, Item as string)
local Result as integer
Result = 0
set text opaque
ink 0, -1
if mousex()>=xPos*8 and mousex()<(xPos+len(Item))*8 and mousey()>=yPos*16 and mousey()<(yPos+1)*16
ink -1, 0
if mouseclick()
Result = 1
endif
endif
Text xPos*8, yPos*16, Item
set text transparent
endfunction Result