@ Kieran
Amen!
@ TDK
People just don't like to be told the truth sometimes.
@ white boy kyle
One set of commands that'll help wrangle menus and (looking at your other messages) give you the ability to pick random questions from a list of many is the select/case commands.
cls
Sync On : Sync Rate 40
` Set the starting menu
CMenu=1
do
` Make the current menu equal the variable returned by the function
CMenu=ShowMenu(CMenu)
` If CMenu=6 exit the do/loop
if CMenu=6 then exit
loop
cls
print "Actual Game"
sync
wait key
end
function ShowMenu(Menu)
cls
` Find the current menu using the variable "Menu"
select Menu
` Main Menu
case 1
if Button(20,55,"New Game")=1 then Menu=2
if Button(20,135,"Multiplayer")=1 then Menu=3
if Button(20,215,"Options")=1 then Menu=4
If Button(20,295,"Exit")=1 then Menu=5
` Stop this case
endcase
` Setup Game
case 2
if Button(20,55,"Set up Game")=1 then Menu=1
if Button(20,135,"Play Game")=1 then Menu=6
endcase
` Multiplayer
case 3
print "Try Again ( Menu = 3 )"
sync
wait key
Menu=1
endcase
` Options
case 4
print "Try Again ( Menu = 4 )"
sync
wait key
Menu=1
endcase
` Exit
case 5
print "Try Again ( Menu = 5 )"
sync
wait key
Menu=1
endcase
` Stop the "select"
endselect
sync
endfunction Menu
function Button(x,y,tex$)
` Change color to bright white
ink rgb(255,255,255),0
` Create a switch
Pressed=0
` Check if the mouse is over the text area
if mousex()=>x and mousex()<=x+text width(tex$) and mousey()=>y and mousey()<=y+text height(tex$)
` If the mouse is over the text area change color to red
ink rgb(255,0,0),0
` Check for a mouse click
if mouseclick()
` If one of the mouse buttons is down wait for the user to let go of the mouse button
while mouseclick()>0
endwhile
` Turn the switch on
Pressed=1
endif
endif
` Print the text
text x,y,tex$
` Leave the function with the switch
endfunction Pressed
