Ok, it took a bit of time but I got your code working but I made a few changes and have only commented out parts of your original program.
Here is the code, it may not be commented to well though
Rem ***** Main Source File *****
Rem Project: Main Menu
Rem Created: Thursday, July 15, 2010
Rem ***** Main Source File *****
Rem Sync
Sync On
Sync Rate 60
Disable Escapekey
Rem Going To Main Menu
GoSub MainMenu
Gosub ExitGameArraw
global exit_game as boolean = 0 // controls when exit game function is to run
global quit as integer = 0 // a variable for the exit menu, used for selection
Rem Main Loop
Do
cls
Rem Main Menu Select
Rem Select New Game/Color Text Red
If SelectedItem <> 0
Ink White, 0
Center Text Screen Width()/2,200,MainMenuItems$(0)
Else
Ink Red, 0
Center Text Screen Width()/2,200,MainMenuItems$(0)
Endif
Rem Select Load Game/Color Text Red
If SelectedItem <> 1
Ink White, 0
Center Text Screen Width()/2,220,MainMenuItems$(1)
Else
Ink Red, 0
Center Text Screen Width()/2,220,MainMenuItems$(1)
Endif
Rem Select Options/Color Text Red
If SelectedItem <> 2
Ink White, 0
Center Text Screen Width()/2,240,MainMenuItems$(2)
Else
Ink Red, 0
Center Text Screen Width()/2,240,MainMenuItems$(2)
Endif
Rem Exit/Color Text Red
If SelectedItem <> 3
Ink White, 0
Center Text Screen Width()/2,260,MainMenuItems$(3)
Else
Ink Red, 0
Center Text Screen Width()/2,260,MainMenuItems$(3)
Endif
Rem Checking To See If Up Is Pressed
If Upkey()=0 and Up = 1
Up = 0
Endif
Rem Cycling Up Through Main Menu
If Upkey()=1 and Up = 0
SelectedItem = SelectedItem - 1
Up = 1
Endif
Rem Checking To See If Down Is Pressed
If Downkey()=0 and Down = 1
Down = 0
Endif
Rem Cycling Down Through Main Menu
If Downkey()=1 and Down = 0
SelectedItem = SelectedItem + 1
Down = 1
Endif
Rem If SelectedItem Is At New Game When Up Is Pressed It Starts At Exit
If SelectedItem < 0
SelectedItem = 3
Endif
Rem If SelectedItem Is At Exit When Down Is Pressed It Starts At New Game
If SelectedItem > 3
SelectedItem = 0
Endif
Rem Gosub Exit Game
If SelectedItem = 3 and Returnkey()=1
//Gosub ExitGame
exit_game = 1 // turn exit game funciton on
Endif
if exit_game = 1 // run exit game function
exitgame1()
endif
Rem Updating Screen
Sync
Rem Looping
Loop
Rem Main Menu Array
MainMenu:
Dim MainMenuItems$(4)
MainMenuItems$(0) = "New Game"
MainMenuItems$(1) = "Load Game"
MainMenuItems$(2) = "Options"
MainMenuItems$(3) = "Exit"
return
Rem Exit Array
ExitGameArraw:
Dim ExitGameItems$(3)
ExitGameItems$(0) = "Are you are you want to Exit?"
ExitGameItems$(1) = "Yes"
ExitGameItems$(2) = "No"
Rem SelectedItem Starts At 0
SelectedItem = 0
Rem Red/White Color
Red = RGB(255,0,0)
White = RGB(255,255,255)
Rem Up/Down Starts At 0
Up = 0
Down = 0
Rem Returns
Return
// Rem Exit Game
ExitGame:
//Repeat
CLS
Center Text Screen Width()/2,220,ExitGameItems$(0)
If SelectedItem <> 0
Ink White, White
Endif
// exit game function
function Exitgame1()
wait 100 // gives the user and program time so everything doesn't happen instantly
CLS
Ink rgb(255,255,255),0
Center Text Screen Width()/2,220,ExitGameItems$(0)
If SelectedItem <> 0
Ink White, 0
Endif
if upkey()=1 and quit = 1 then quit = 0
if downkey()=1 and quit = 0 then quit = 1
// select yes
if quit = 0
ink rgb(255,0,0), 0
Center Text Screen Width()/2,240,ExitGameItems$(1)
ink rgb(255,255,255), 0
Center Text Screen Width()/2,260,ExitGameItems$(2)
endif
// select no
if quit = 1
ink rgb(255,255,255), 0
Center Text Screen Width()/2,240,ExitGameItems$(1)
ink rgb(255,0,0), 0
Center Text Screen Width()/2,260,ExitGameItems$(2)
endif
if returnkey()=1 and quit = 0 then end // end program
if returnkey()=1 and quit = 1 then exit_game = 0 // turns exit game function off
endfunction
Edit Oh yeah, if you use this in you main program make sure to make a back up of your original code.
A clever person solves a problem, a wise person avoids it - Albert Einstein