write a list of the objects created with their media numbers then create a function that loads them all into the correct sequence,its easy this way to also make one that destroys all the media ready for the next level.
say for example we have a game with 10 objects and a matrix
instead of destroying the matrix we just update its height values to save load time.
If the models need to be reloaded then we destroy all of level one media and reload them back in.
a player model usually doesnt have to be reloaded as well as head up display data so its best to make a list with two columns, ones that need to be destroyed and ones that need to be hidden until the next level.
dont forget its sometimes essential to undim arrays but usually flushing data in them is ok until the end of the game where you do have to undim them as well as all media
how can I make this simpler?
instead of using functions you can change your main games loop to a while /endwhile command. this will make the main loop work until a condition is met, in this example its the escapekey. Using gosubs to load and destroy your data keeps all local and globular
gosubs
rem pre main
disable escapekey
while escapekey()=0
rem inside of main loop
sync
endwhile
rem end program and cleanup