lets say you have a game where you fly around and shoot all the bad guys until they are all dead, at which you go to the next level. To load the next level, all you do is run the code you ran to start the game, except that you increase the amount of enemies you create. So if you had something like
`set up the game
function setUpGame(badguys)
for e = 1 to badguys
sprite e,rnd(screen width()),rnd(screen height()),1
next e
endfunction
Then when you want to go to a new level, call the setUpGame function, but increase the badguys parememeter each time.
This is a really over simplified example, because youll also need to load up all sorts of other stuff too depending on what your game is. For example, maybe you need to load a custom map from a txt file, if thats the case, then maybe you could name all your levels to a convention so that you dont have to hardcode them into your source.
function setUpGame(badguys, level)
open to read "level"+str$(level)+".txt",1
`insert loading from txt code
`use a for loop to make badguys
endfunction
And again, thats still really overly simple, becuase chances are, youll need to do some trash clean up, and display messages like "new level!!!" over the screen. But this is a start...