示例#1
0
  public void show() {
    Object det = InterScreenData.getInstance(NerdShooter.COMP_DATA).getData();

    if (det != null) {
      XPMLItem item = (XPMLItem) det;
      completed = Long.parseLong(item.getElementValue(KEY_COMPLETED_TIME)) / 10D;
      int finishType = Integer.parseInt(item.getElementValue(KEY_FINISH_TYPE));
      level = Integer.parseInt(item.getElementValue(KEY_LEVEL_NUM));

      switch (finishType) {
        case ExitBlock.EXIT_NOCLEAR:
          message = "Didn't Finish Level " + level;
          break;
        case ExitBlock.EXIT_NORMAL:
          message = "Completed Level " + level + "in\n" + completed + " seconds.";
          break;
        default:
          message = "Hacker";
          break;
      }
    }

    batch = new SpriteBatch();

    Gdx.input.setInputProcessor(this);
  }
示例#2
0
  public static void finishLevel(int code) {
    XPMLItem item = new XPMLItem("data");
    item.addElement(CompletedLevel.KEY_COMPLETED_TIME, (long) ((gameTicks / 60D) * 10L) + "");
    item.addElement(CompletedLevel.KEY_FINISH_TYPE, code + "");
    item.addElement(CompletedLevel.KEY_LEVEL_NUM, levelNum + "");

    InterScreenData.getInstance(NerdShooter.COMP_DATA).setData(item);

    NerdShooter.shooter.setScreen(CompletedLevel.instance);
  }