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.

39 lines
1.0 KiB

2 years ago
  1. package base;
  2. import java.io.IOException;
  3. import org.apache.logging.log4j.LogManager;
  4. import org.apache.logging.log4j.Logger;
  5. import playground.*;
  6. /**
  7. * main class to start a game with only one level.
  8. *
  9. */
  10. public class BreakoutGame extends GameLoop {
  11. private static Logger logger = LogManager.getLogger(BreakoutGame.class);
  12. /**
  13. * adds only one level to play ({@link playground.LevelBreakout1}).
  14. */
  15. @Override
  16. public void defineLevels() {
  17. this.resetLevels(); // removes Level1 added by superclass constructor
  18. this.addLevel(new BreakoutLevel1());
  19. }
  20. /**
  21. * starts this game.
  22. *
  23. * @param args command line parameters (forwarded to {@link GameLoop#runGame(String[])}).
  24. * @throws IOException if highscore.txt file cannot be written or accessed, the exception is
  25. * thrown (and game ends).
  26. */
  27. public static void main(String[] args) throws IOException {
  28. GameLoop myGame = new BreakoutGame();
  29. logger.info("BreakoutGame program started.");
  30. myGame.runGame(args);
  31. }
  32. }