Advertisement
huneater

Test - MainComponent.java

Apr 11th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement