So I had to set up a Hugh array to be able to switch levels back and forth.
This is fine and works well, But I have to leave out some integers at the top of my code as when the level changes it resorts back to the original values to the next level.
So if my player health if 40 and the next level loads from the top of my code then my players health goes back to 100.
So I have learned to leave out what health equals or other values as a integer just to save the values to the next level change.
In this I have learned not every little thing needs to be recorded at the top of your loop and some things should be opted out unless called for.
Also I have to create two the three diffrent values just to keep some recorded information like a example bellow.
If level_section=0 then player_health=0
this will reset my health back to 100 only if level_section=0 but my players can swich back and forth from each level any time.
So I have to create a third value to stop it from changing, thats a lot of other values I dont need, Just to change levels.
Now I am using a saving system that works well.
So my point here is if you want to swich bck and forth from one level to the next and back you will have to use a saving sytem just for that reason.
Also there is another problem, if my player is in the loop, and your playing level 1 section 2, then only things in that level section can happen, so I have to record what level section is being played.
This is another three values I have to record.
Thats a lot to keep track of.
I need a array that holds all the information for all the sections of all the levels.
This is just a tip for any one who wants to create a game that switches levels back and forth.
So making a array then saving that information to a file then loading that array back and forth between levels looks like the only way to get around this issue.