I have the following classes
1- Level Class which has
Stage stage;
MyActor[] myActors;
boolean isCompleted = false;
public void checkSolution() {
if(myActor[0].getRotation() > 180) {
isCompleted = true;
}
}
public void render(float delta) {
stage.act(delta);
stage.draw();
checkSolution();
}
2- Data Class which holds an ArrayList<Level> levels
3- GameScreen Class which has these methods
@Override
public void show() {
data = new Data();
data.loadLevels();
level = data.levels.get(0);
Gdx.input.setInputProcessor(level.stage);
}
@Override
public void render(float delta) {
level.render(delta);
}
How to move to the next level and remove the previous one from memory ?
Where should I call stage.dispose()
of the previous level ?