Want more features on Pastebin? Sign Up, it's FREE!
Guest

Test - MainComponent.java

By: huneater on Apr 11th, 2013  |  syntax: Java  |  size: 0.89 KB  |  views: 62  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package main;
  2.  
  3. import org.newdawn.slick.AppGameContainer;
  4. import org.newdawn.slick.GameContainer;
  5. import org.newdawn.slick.SlickException;
  6. import org.newdawn.slick.state.StateBasedGame;
  7.  
  8. /**
  9.  * User: Zsolt
  10.  * Date: 2013.04.11.
  11.  * Time: 19:10
  12.  */
  13.  
  14. public class MainComponent extends StateBasedGame {
  15.     public static final void main(String[] args) throws SlickException {
  16.         AppGameContainer app = new AppGameContainer(new MainComponent("TITLE"));
  17.         app.setDisplayMode(800, 600, false);
  18.         app.setVSync(true);
  19.         app.start();
  20.     }
  21.  
  22.     public MainComponent(String name) {
  23.         super(name);
  24.     }
  25.  
  26.     @Override
  27.     public void initStatesList(GameContainer gameContainer) throws SlickException {
  28.         this.addState(new GameState()); // Add the GameState class to the states list
  29.         // Note: the last added state will be automatically loaded
  30.     }
  31. }
clone this paste RAW Paste Data