Package beaver.game

Source Code of beaver.game.BeaversGame

package beaver.game;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

public class BeaversGame extends StateBasedGame {
 
  public static final int SPLASHSCREENSTATE = 0;
  public static final int MAINMENUSTATE = 1;
  public static final int GAMEPLAYSTATE = 2;
  public static final int CLIENTSTATE = 3;
 
  public BeaversGame() {
    super("Beavers!");
   
    this.addState(new SplashScreenState(SPLASHSCREENSTATE));
    this.addState(new GameplayState(GAMEPLAYSTATE));
    this.addState(new MainMenuState(MAINMENUSTATE));
    this.enterState(SPLASHSCREENSTATE);
    //this.enterState(GAMEPLAYSTATE);
   
    //this.addState(new ClientState(CLIENTSTATE,"localhost"));
    //this.enterState(CLIENTSTATE);
   
  }
 
  /**
   * @param args
   * @throws SlickException
   */
  public static void main(String[] args) throws SlickException {
    AppGameContainer container = new AppGameContainer(new BeaversGame(),
        800, 600, false);
    container.setShowFPS(false);
    container.start();
  }

  @Override
  public void initStatesList(GameContainer gc) throws SlickException {
    //this.getState(SPLASHSCREENSTATE).init(gc, this);
    //this.getState(MAINMENUSTATE).init(gc, this);
  }

}
TOP

Related Classes of beaver.game.BeaversGame

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.