Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package settingUp;
- import org.newdawn.slick.*;
- import org.newdawn.slick.state.*;
- public class Game extends StateBasedGame
- {
- public static final String gamename = "mario";
- public static final int menu = 0;
- public static final int play = 1;
- public static final int copyright = 2;
- public static final int mouseGame = 3;
- public static final int youwin = 4;
- public static final int nextLevel = 5;
- public static final int play1 = 6;
- public static final int play2 = 7;
- public static final int play3 = 8;
- public static final int play4 = 9;
- public static final int nextLevel1 = 10;
- public static final int nextLevel2 = 11;
- public static final int nextLevel3 = 12;
- public Game(String gamename)
- {
- super(gamename);
- this.addState(new Menu(menu));
- this.addState(new Play(play));
- this.addState(new Play1(play1));
- this.addState(new Play2(play2));
- this.addState(new Play3(play3));
- this.addState(new Play4(play4));
- this.addState(new Copyright(copyright));
- this.addState(new MouseGame(mouseGame));
- this.addState(new youWin(youwin));
- this.addState(new nextLevel1(nextLevel1));
- this.addState(new nextLevel(nextLevel));
- this.addState(new nextLevel2(nextLevel2));
- this.addState(new nextLevel3(nextLevel3));
- }
- @Override
- public void initStatesList(GameContainer gc) throws SlickException {
- this.getState(menu).init(gc, this);
- this.getState(play).init(gc, this);
- this.enterState(menu);
- }
- public static void main(String[] args)
- {
- AppGameContainer appgc;
- try{
- appgc = new AppGameContainer(new Game(gamename));
- appgc.setDisplayMode(640, 360, false);
- appgc.start();
- }catch(SlickException e)
- {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement