Advertisement
Guest User

גכע

a guest
Jul 22nd, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. package settingUp;
  2.  
  3. import org.newdawn.slick.*;
  4. import org.newdawn.slick.state.*;
  5. public class Game extends StateBasedGame
  6. {
  7. public static final String gamename = "mario";
  8. public static final int menu = 0;
  9. public static final int play = 1;
  10. public static final int copyright = 2;
  11. public static final int mouseGame = 3;
  12. public static final int youwin = 4;
  13. public static final int nextLevel = 5;
  14. public static final int play1 = 6;
  15. public static final int play2 = 7;
  16. public static final int play3 = 8;
  17. public static final int play4 = 9;
  18. public static final int nextLevel1 = 10;
  19. public static final int nextLevel2 = 11;
  20. public static final int nextLevel3 = 12;
  21.  
  22.  
  23.  
  24. public Game(String gamename)
  25. {
  26. super(gamename);
  27. this.addState(new Menu(menu));
  28. this.addState(new Play(play));
  29. this.addState(new Play1(play1));
  30. this.addState(new Play2(play2));
  31. this.addState(new Play3(play3));
  32. this.addState(new Play4(play4));
  33. this.addState(new Copyright(copyright));
  34. this.addState(new MouseGame(mouseGame));
  35. this.addState(new youWin(youwin));
  36. this.addState(new nextLevel1(nextLevel1));
  37. this.addState(new nextLevel(nextLevel));
  38. this.addState(new nextLevel2(nextLevel2));
  39. this.addState(new nextLevel3(nextLevel3));
  40. }
  41. @Override
  42. public void initStatesList(GameContainer gc) throws SlickException {
  43. this.getState(menu).init(gc, this);
  44. this.getState(play).init(gc, this);
  45. this.enterState(menu);
  46. }
  47. public static void main(String[] args)
  48. {
  49. AppGameContainer appgc;
  50. try{
  51. appgc = new AppGameContainer(new Game(gamename));
  52. appgc.setDisplayMode(640, 360, false);
  53. appgc.start();
  54. }catch(SlickException e)
  55. {
  56. e.printStackTrace();
  57. }
  58.  
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement