I have a Manic Miner style game where you need to collect all the items from a screen before you can advance to the next screen.
I have a screen class called "PlayScreen" wich starts out by loading a tiled map called "Level1.tmx", and contains the render and update loop.
public class PlayScreen implements Screen { ... } This screen is loaded by my main Game class, by calling SetScreen
setScreen(new PlayScreen(this)); So inside my PlayScreen, what is the correct way to restart the game but with a different level? I know I can pass through a new level number to get it to load a new tiled map, but this usually crashes.
Do I need to dispose of the screen and reload it again. I cannot find much information about this. Most LibGDX tutorials only cover a single screen or level, or have a menu screen in between. I just want to switch to the next level or room on demand, but cannot get it working.
Has anyone done this before - can you recommend a good way of doing this?
Regards
James