Alright, so I’m working “hard” on the gui for my game. But I’m wondering how best to handle different screens.
Currently I have an interface called Screen, which all screens implement, this interface defines an update() method and a render() method. So these has to be implemented whenever you create a new screen. My question is, how best to handle new screens, e.g. when you’re in the main menu and you go to a submenu, etc. how should I go about switching them?
Should I just replace the content of the screen variable, in the Game class, with a new instance of a screen, and then just reinitialize the screen whenever I go back to a previous menu?
Cheers!