You start the game.Start New game.Load level 1.Play,play,play...
You are at end of it!I assume your levels contains start position of the player, object data and stuff like that.What you have to make is routine that free up resources when the level is cleared by the player, at the same time you put a loadscreen to hide what is loaded behind(actually is good to first put loadscreen and then call the cleaning routine).Then you start loading level 2, move player to start position at level 2 and so on until the very end.
What do you mean your levels are text files?Is everything in them readable in Notpad or Wordpad?If it`s not then they are text files because you leave them with *.txt, you can change to whatever you want.
I use matrix1 I/O for files and i`m not sure what are you using,but
with matrix1 i need to do something like this to load my level:
open datafile to read 1, "level1.lvl"
If i needed sufficient system for loading levels i would need to just watch over the current level.I need variable "current_level" which i need to increment every time the player finish the current level, just before my loading routine.If current_level = 0 means there is no level loaded, increment and go to loading routine to load level 1.And the above line can become something like this:
open datafile to read 1, "level"+current_level+".lvl"
You no longer care which level the game is loading, you can be sure that when finish level condition is met, your game will inc "current_level" and the next level loaded is the right one.
You need just to rename your levels accordingly "level1.lvl","level2.lvl", etc.
Where there is a will, there is a way.
I often edit my posts, that`s who i am
