コード例 #1
0
ファイル: States.java プロジェクト: GOGO98901/Lost
  public void switchTo(State state) {
    Log.info("Changing game state to [" + state + "] from [" + current + "]");
    game.updateLimiter.changedState();
    game.enterState(state.ordinal(), new FadeOutTransition(), new FadeInTransition());

    ScreenState last = (ScreenState) game.getState(current.ordinal());
    ScreenState next = (ScreenState) game.getState(state.ordinal());

    if (state == State.GAME) {
      ((GameState) next).start();
    } else if (current == State.GAME) {
      ((GameState) last).close();
    }
    current = state;
  }
コード例 #2
0
ファイル: States.java プロジェクト: GOGO98901/Lost
 public GameState getGameState() {
   return (GameState) game.getState(State.GAME.ordinal());
 }
コード例 #3
0
ファイル: States.java プロジェクト: GOGO98901/Lost
 public void init(GameContainer container, GameThread game) {
   DisplayWindow.setUpGameContainer(container);
   game.addState(new IntroState(game, width, height, State.INTRO.ordinal()));
   game.addState(new MenuState(game, width, height, State.MENU.ordinal()));
   game.addState(new GameState(game, width, height, State.GAME.ordinal()));
 }