Exemplo n.º 1
0
  public void LoadNewMethod(World world) {
    // load boxr

    Parameters params = new Parameters();
    params.textureMinFilter = TextureFilter.Linear;
    params.textureMagFilter = TextureFilter.Linear;

    TiledMap tileMap = new TmxMapLoader().load("Maps/level" + GameStats.Level + ".tmx");

    for (TiledMapTileSet tileSet : tileMap.getTileSets()) {
      Iterator<TiledMapTile> it = tileSet.iterator();
      while (it.hasNext()) {

        it.next()
            .getTextureRegion()
            .getTexture()
            .setFilter(TextureFilter.Linear, TextureFilter.Linear);
      }
    }
    // LoadTilesWithBody(tileMap, world);
    // LoadTilesWithoutBody(tileMap, world);
    LoadGameTiles(tileMap, world);
    renderer = new OrthogonalTiledMapRenderer(tileMap, 1 / 100f);

    // tileMap.dispose();

  }
 private void _loadSpecialTilesRoutine(TiledMap map) {
   // System.out.println("_loadSpecialTilesRoutine");
   Iterator<TiledMapTile> tiles = map.getTileSets().getTileSet(0).iterator();
   // System.out.println(map.getTileSets().getTileSet(0).size());
   while (tiles.hasNext()) {
     TiledMapTile tile = tiles.next();
     if (tile.getProperties().containsKey("debug")) {
       // System.out.println("debug tile found!!");
       debugCell = new Cell();
       debugCell.setTile(tile);
     } else if (tile.getProperties().containsKey("collidable")) {
       // System.out.println("collidable tile found!!");
       collidableCell = new Cell();
       collidableCell.setTile(tile);
     }
   }
 }