I think it should be possible to do in code, when you load your tmx, to check which tileset and wich tile a cell belongs to. Like this you could define a mapping (either in code or in an external text file). Then you just need to check if the level cell belongs to the blocked tiles.
I’m commuting right now, so I can’t make any example code. But it should be pretty straight forward to implement.
Maybe you could tell us what library you use to load the tmx (slick, libgdx or something different?)
Edit:
A short piece of code of how it could look like in libgdx with TiledMap (but it is not tested, so maybe you have to fiddle around a bit).
This code iterates through all tile sets and tiles. The isBlockingTile method simply checks some constraints (in this case the tilesets name needs to be “foo” and the tile id 2 or 4) and if they are met, it adds the property to the tile.
public void bar() {
TiledMap map = null;
// TODO: Load tiled map
TiledMapTileSets sets = map.getTileSets();
for (TiledMapTileSet set : sets) {
for (TiledMapTile tile : set) {
if (isBlockingTile(set, tile)) {
tile.getProperties().put("blocks", true);
}
}
}
}
private boolean isBlockingTile(TiledMapTileSet set, TiledMapTile tile) {
String name = set.getName();
if (name == "foo" && (tile.getId() == 2 || tile.getId() == 4)) {
return true;
}
return false;
}