public void setCurrentState(State newState) { System.gc(); newState.init(); currentState = newState; inputHandler.setCurrentState(currentState); }
public void onResume() { if (currentState != null) { currentState.onResume(); } }
private void updateAndRender(long delta) { currentState.update(delta / 1000f); currentState.render(graphics); renderGameImage(); }
public void onPause() { if (currentState != null) { currentState.onPause(); } }