Exemplo n.º 1
0
	public static java.util.ArrayList<AnimatedSpriteTower> GetAllAnimatedSpriteTowers(
			MainGame game) {

		int num = 10;

		java.util.ArrayList<AnimatedSpriteTower> list = new java.util.ArrayList<AnimatedSpriteTower>();

		RefObject<Integer> num2 = new RefObject<Integer>(0);
		list.add(new AnimatedSpriteTower(game, GetTextureFile(TowerType.Axe,
				"png/", num2), new Vector2f((float) num, 18f), num2.argvalue));
		num2.argvalue = 0;

		list.add(new AnimatedSpriteTower(game, GetTextureFile(TowerType.Spear,
				"png/", num2), new Vector2f((float) num, 118f), num2.argvalue));
		num2.argvalue = 0;

		list.add(new AnimatedSpriteTower(game, GetTextureFile(
				TowerType.AirDefence, "png/", num2), new Vector2f((float) num,
				218f), num2.argvalue));
		num2.argvalue = 0;

		list.add(new AnimatedSpriteTower(game, GetTextureFile(TowerType.Lur,
				"png/", num2), new Vector2f((float) num, 318f), num2.argvalue));
		num2.argvalue = 0;

		return list;
	}
Exemplo n.º 2
0
  public final boolean LoadLevel(
      int level,
      RefObject<Integer> speed,
      RefObject<java.util.ArrayList<Tile>> tiles,
      RefObject<java.util.ArrayList<Tile>> caves,
      RefObject<java.util.ArrayList<ScheduleItem>> schedule) {
    try {
      ArrayByte bytes = BaseIO.loadArrayByte("assets/levels/level_" + level + ".lev");
      ArrayByteReader reader = new ArrayByteReader(bytes);
      String record;
      for (; (record = reader.readLine()) != null; ) {

        String tempVar = record.substring(0, 1);
        if (tempVar.equals("t")) {
          Tile tile = new Tile();
          tile.InitWithString(record.substring(2));
          tiles.argvalue.add(tile);
        } else if (tempVar.equals("c")) {
          Tile tile2 = new Tile();
          tile2.InitWithString(record.substring(2));
          caves.argvalue.add(tile2);
        } else if (tempVar.equals("s")) {
          speed.argvalue = Integer.parseInt(record.substring(2));

        } else if (tempVar.equals("x")) {
          String[] strArray = record.substring(2).split("[,]", -1);
          int aCaveId = Integer.parseInt(strArray[0]);
          int aTicks = Integer.parseInt(strArray[1]);
          ScheduleItem item = new ScheduleItem(aCaveId, aTicks);
          schedule.argvalue.add(item);
        }
      }
      reader.close();
    } catch (Exception e) {
      return false;
    }
    return true;
  }
Exemplo n.º 3
0
	private static String GetTextureFile(TowerType towerType, String subDir,
			RefObject<Integer> spriteCount) {
		String str = "";
		spriteCount.argvalue = 0x24;
		switch (towerType) {
		case Axe:
			str = "towerinfo1";
			break;

		case Spear:
			str = "towerinfo2";
			break;

		case AirDefence:
			str = "towerinfo3";
			break;

		case Lur:
			str = "towerinfo4";
			break;
		}
		return ("assets/" + subDir + str + ".png");
	}