This is how I do multi-levels and menus:
Basically, the whole game is one big loop like so:
do
if mode = 1 then goSub Menu
if mode = 2 then goSub Game
if mode = 3 then end
loop
When the app first starts, put this:
so the player is taken to the menu when starting.
In you menu screen, when you want to start the game, put something like this:
` Start the game
if starting_game = 1
level = 1
mode = 2
return
endif
So you quit the menu sub, get taken to the main loop where the game is started. Inside the Game sub everything would just be like normal, load stuff etc. then have a big main loop.
I you want to have several levels, I'd first save some info in a text file, with a name like lev1.lvl:
#level file
levels/level1.x
#starting position
0
200
20
And then use some code like to this to obtain tho information:
`Load level info
open to read 1,"level/level" + str$(level) + ".lvl"
read string 1,null$
read string 1,levelname$
etc.
At the end of your game, as people have said delete all objects then you can exit that sub and get taken back to the main lop, where if you set mode to 1 you'd be at a menu again.
Hope it helps
"They misunderestimated us" - George Bush
"The box said 'Requires Windows 95 or better'. So I installed LINUX. "
Formerly David89.