Example #1
0
  public NewGameScreen(Main m) {
    super(m);

    difficulty.selection = Difficulty.NORMAL_ID;

    container.elements.add(difficulty);
    container.elements.add(
        new Button((Settings.DEFAULT_WIDTH / 2) - 80, 150, 160, 32, "menu.start") {

          @Override
          public boolean onLeftClick() {
            main.progress.clear();
            main.progress.putInteger("difficulty", difficulty.selection);
            main.progress.flush();

            main.getPref("settings").putBoolean("saveExists", true).flush();

            Main.LEVELSELECT.offset = 0;
            Main.LEVELSELECT.wanted = 0;
            Main.LEVELSELECT.velocity = 0;

            main.transition(
                new FadeIn(Color.BLACK, 0.5f), new FadeOut(Color.BLACK, 0.5f), Main.LEVELSELECT);

            Runtime.getRuntime().gc();

            return true;
          }
        });
    container.elements.add(
        new BackButton(Settings.DEFAULT_WIDTH - 37, Gdx.graphics.getHeight() - 37) {

          @Override
          public boolean onLeftClick() {
            main.setScreen(Main.MAINMENU);
            return true;
          }
        });
  }
Example #2
0
 @Override
 public void show() {
   difficulty.selection = Difficulty.NORMAL_ID;
 }