Hello guys …
I have been programming my first game in lwjgl and I get stuck thinking how to make some sort of game stage/scene management in the main class (who create the Display and AL)
I make the following Interface
package interfaces;
import gametools.TimerTool;
public interface Stage {
public void setUpObjects();
public void draw();
public void update(TimerTool timer);
public void input();
public void unloadObjects();
}
and an Abstract class for my game stages classes…
but Im not sure how to manage the navigation between one stage to another …
I follow some tutorials that propose making something like this in the main class
public enum GameState {
INTRO, MAIN_MENU, GAME;
}
private void checkInput() {
switch (state) {
case INTRO:
if(Keyboard.isKeyDown(Keyboard.KEY_RETURN)){
state=State.MAIN_MENU;
}
if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)){
Display.destroy();
System.exit(0);
}
break;
case GAME:
if(Keyboard.isKeyDown(Keyboard.KEY_BACK)){
state=State.MAIN_MENU;
}
break;
case MAIN_MENU:
if(Keyboard.isKeyDown(Keyboard.KEY_RETURN)){
state=State.GAME;
}
if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)){
state=State.INTRO;
}
break;
}
}
and rendering and updating different stuff depending on the current stage … but it is pretty basic …
How can i manage this transition when each stage have his own class (extending my Abstract Stage class) and make each class capable to say to the main class go to n stage, unload his content and the main class load the next stage?, and if its possible want to render and update two stages at the same time (like OPTION over MAIN_MENU, and OPTIONS over GAME).
Has been thinking in static stages or something like that but nothing accomplish what I want … :clue:
can anyone make me some suggestions …
thank you a lot…
by the way … forgive me if my english is a bit primitive … its not my native language