@Override public void enter(GameContainer container, StateBasedGame game) throws SlickException { super.enter(container, game); currentState = State.USED; ControllerUtils.clearInputQueue(container.getInput()); view.enter(); }
@Override public void enter(GameContainer container, StateBasedGame game) throws SlickException { super.enter(container, game); started = false; quit = false; wtf = false; }
@Override public void leave(GameContainer container, StateBasedGame game) throws SlickException { super.leave(container, game); world = null; // TODO: Musicクラスの利用 music.stop(); }
@Override public void leave(GameContainer container, StateBasedGame game) throws SlickException { super.leave(container, game); currentState = State.NOT_USED; // clean up the model before the next game resetGame(); }
@Override public void enter(GameContainer container, StateBasedGame game) throws SlickException { // TODO Auto-generated method stub super.enter(container, game); // Factory this.factory = new GameFactory(); // Level this.levelId = factory.createEntity(EntityType.LEVEL); // FrameBuffer frameBuffer = new Image(Settings.SCREENWIDTH, Settings.SCREENHEIGHT); }
@Override public void enter(GameContainer container, StateBasedGame game) throws SlickException { super.enter(container, game); keyInput = new KeyInput(); world = new World(this); world.init(); // TODO: Musicクラスの利用 music.setPosition(0); music.play(); music.loop(); // ゲーム中に動的に曲を変えたい場合 // このBasicGameStateクラスが持つクラス // 今回で言えば,Battleクラスが持つWorldクラスに, // Battleクラスの参照を渡しておき, // MusicChangeメソッドなどを作成し,呼び出させるという方法がある. // 他にも,ShootingGameクラスなどのStateBasedGameクラスに音楽管理クラスを // 持たせ,そこで管理するという方法もある. }
@Override public void keyReleased(int key, char c) { super.keyReleased(key, c); keyInput.keyReleased(key, c); }