Package jsalis.game

Source Code of jsalis.game.GameController

package jsalis.game;

import jsalis.framework.StateManager;
import jsalis.framework.StateType;

public class GameController {
 
  private GameView gameView;
  private StateManager stateManager;
 
  public GameController() {
    gameView = new GameView(this);
    stateManager = new StateManager(GameView.WIDTH, GameView.HEIGHT, gameView.getContentPane());
    stateManager.addState(new GameState(StateType.GAME, stateManager));
    stateManager.addState(new MenuState(StateType.MENU, stateManager));
    gameView.start();
    stateManager.startCurrentState();
  }
 
 
  public void setCurrentState(StateType type) {
    stateManager.setCurrentState(type);
  }
 
 
  public void requestFocus() {
    stateManager.requestFocus();
  }
 
}
TOP

Related Classes of jsalis.game.GameController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.