Making an overworld map (i.e. super mario world)

Just curious how I would get my level to end, go to the world map and start whatever level I select. I think I know how to do the other stuff, I’m just unsure of going from one level to the next.

I’ve thought on this concept a bit, since I’m working on a project that will implement something similar; but I haven’t done any implementation yet.

I would think that each level would have the name of the overworld map stored as a String; probably within each map’s Level Blueprint (since it’s unique to each map); so that when the level ends, you can load a level/map based on whatever name is stored in that String.

Then the overworld map would have some way for you to select the level you want to play (the method of selection would vary depending on the input device your game uses: keyboard, mouse, gamepad, or touch screen). Then when a specific level is selected, it would set a String variable equal to the name of the level to load (again, probably in the Level Blueprint, or possibly the GameState), and then when trying to load the level to play, you’d use the String variable as the name of the level to load.

Basically, when ‘selecting’ a level, what’re you’re really doing is updating the String variable that’s holding the name of the level to be loaded. Then when you try to load the level (for example by pressing the “Enter” key on the keyboard), you would load the level with the name that’s been stored in the String.

Hope that helps!