You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

  1. package base;
  2. import java.io.IOException;
  3. import java.util.ArrayList;
  4. import playground.Level1;
  5. import playground.Level2;
  6. import playground.Level3;
  7. import playground.Level4;
  8. import playground.Playground;
  9. /**
  10. * main class to start a game with four levels {@link playground.Level1} {@link playground.Level2}
  11. * {@link playground.Level3} and {@link playground.Level4}.
  12. *
  13. */
  14. public class BuggyGame extends GameLoop {
  15. /** constructor that defines {@link GameLoop#levels} with 4 levels (instances of {@link playground.Level1}
  16. * {@link playground.Level2} {@link playground.Level3} and {@link playground.Level4}.
  17. */
  18. public BuggyGame() {
  19. super();
  20. this.levels = new ArrayList<Playground>(4);
  21. this.levels.add(new Level1());
  22. this.levels.add(new Level2());
  23. this.levels.add(new Level3());
  24. this.levels.add(new Level4());
  25. }
  26. /**
  27. * starts this game.
  28. *
  29. * @param args command line parameters (forwarded to {@link GameLoop#runGame(String[])}).
  30. * @throws IOException if highscore.txt file cannot be written or accessed, the exception is
  31. * thrown (and game ends).
  32. */
  33. public static void main(String[] args) throws IOException {
  34. GameLoop myGame = new BuggyGame();
  35. myGame.runGame(args);
  36. }
  37. }