Quote: "I tried GOSUB commands and GOTO commands. I can't get it to work."
The error you mention is raised when you run out of memory and in conjunction with the quote above to me points to you not having a grasp of procedural program layout.
Obviously without seeing your program, it's impossible to be sure, but my guess is that your program is getting into some loop you can't get out of and just eating up memory. This is one of the reasons I always suggest avoiding the Goto command like the plague!
You need to put your menu code inside a loop in a procedure which is called from your main program loop.
Here's a basic format for a game which does what you ask. There's more info on program layout in my tutorials in the stickies if you need it.
Gosub Setup
Gosub MainMenu
Do
Rem Main Program Loop
Sync
Loop
End
Setup:
Rem Set up screen and game variables
Return
MainMenu:
Rem Create User Main Menu With Options, Play Game and Quit buttons etc
PlayGame = 0
Rem Draw Main Menu Screen
Repeat
Rem Repeat Here Until Game Started Or Game Exited
Until PlayGame = 1
Return
TDK_Man