Hey BN2,
Menu code is looking good. Only one issue. I've never messed around with gamma settings so I didn't know how to put that in the options menu.
I'm sure you'll find a few things, so please let me know. thanks
rem menu
rem daygamer
rem Oct 10
rem make the text bigger
set text size 30
rem main menu (pause menu after player has been in the game loop)
do
cls
rem since all these buttons function the same I will discribe just one in detail
rem check if the player's mouse is over the button
if mousex()>120 and mousex()<520 and mousey()>120 and mousey()<180
rem make button icons that will change when the player mouses over them
box 120,120,520,180,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
rem depending on if the program has been to the game loop we will display the main menu or the pause menu
if game_started
ink rgb(255,255,255),0 : center text 320,135,"RESUME"
else
ink rgb(255,255,255),0 : center text 320,135,"START"
endif
rem if the player clicks the mouse then do something
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then gosub game
rem if the player's mouse is not over button
else
box 120,120,520,180,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
if game_started
ink rgb(0,0,0),0 : center text 320,135,"RESUME"
else
ink rgb(0,0,0),0 : center text 320,135,"START"
endif
endif
if mousex()>120 and mousex()<520 and mousey()>210 and mousey()<270
box 120,210,520,270,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
ink rgb(255,255,255),0 : center text 320,225,"OPTIONS"
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then gosub options
else
box 120,210,520,270,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 320,225,"OPTIONS"
endif
if mousex()>120 and mousex()<520 and mousey()>300 and mousey()<360
box 120,300,520,360,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
ink rgb(255,255,255),0 : center text 320,315,"EXIT"
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then end
else
box 120,300,520,360,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 320,315,"EXIT"
endif
sync
loop
rem options menu
options:
rem make the text bigger
set text size 20
do
cls
`if inkey$()="1" then set display mode 640,480,32
`if inkey$()="2" then set display mode 800,600,32
`if inkey$()="3" then set display mode 960,720,32
box 70,210,270,260,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 170,225,"Set Display Mode"
if mousex()>270 and mousex()<370 and mousey()>210 and mousey()<260
box 270,210,370,260,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
ink rgb(255,255,255),0 : center text 320,225,"640 x 480"
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then set display mode 640,480,32
else
box 270,210,370,260,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 320,225,"640 x 480"
endif
if mousex()>370 and mousex()<470 and mousey()>210 and mousey()<260
box 370,210,470,260,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
ink rgb(255,255,255),0 : center text 420,225,"800 x 600"
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then set display mode 800,600,32
else
box 370,210,470,260,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 420,225,"800 x 600"
endif
if mousex()>470 and mousex()<570 and mousey()>210 and mousey()<260
box 470,210,570,260,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
ink rgb(255,255,255),0 : center text 520,225,"960 x 720"
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then set display mode 960,720,32
else
box 470,210,570,260,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 520,225,"960 x 720"
endif
if mousex()>220 and mousex()<420 and mousey()>300 and mousey()<350
box 220,300,420,350,rgb(0,255,0),rgb(255,0,0),rgb(0,255,0),rgb(255,0,0)
ink rgb(255,255,255),0 : center text 320,315,"BACK"
oldmouse = newmouse
newmouse = mouseclick()
rem return to the menu and set text back to big!
if newmouse > oldmouse then set text size 30 : return
else
box 220,300,420,350,rgb(55,0,0),rgb(255,0,0),rgb(55,0,0),rgb(255,0,0)
ink 0,0 : center text 320,315,"BACK"
endif
sync
loop
rem this is where the game will go
game:
cls
rem tell the computer that the game has started so if the player pause it we can make the pause menu look right
game_started = 1
do
text 10,10,"you are in the game"
text 10,30,"click to return to the pause menu"
rem return to the pause menu
oldmouse = newmouse
newmouse = mouseclick()
if newmouse > oldmouse then return
sync
loop
I put a dash of eye candy to the mouse over function. Enjoyed playing with that
yrotate when you can spin?
God Bless!