Hide collision layer in libgdx with TiledMap?

Posted by Daniel Jonsson on Game Development See other posts from Game Development or by Daniel Jonsson
Published on 2012-11-17T04:56:46Z Indexed on 2012/11/17 5:18 UTC
Read the original article Hit count: 445

Filed under:
|
|
|

I'm making a 2D game with libgdx, and I'm using its TileMapRenderer to render my map which I have made in the map editor Tiled. In Tiled I have a dedicated collision layer. However, I can't figure out how I'm supposed to hide it and its tiles in the game.

This is how a map is loaded:

TiledMap map = TiledLoader.createMap(Gdx.files.internal("maps/map.tmx"));
TileAtlas atlas = new TileAtlas(map, Gdx.files.internal("maps"));
tileMapRenderer = new TileMapRenderer(map, atlas, 32, 32);

Currently the collision tiles are rendered on top of everything else, as I see them in the map editor.

© Game Development or respective owner

Related posts about tiles

Related posts about libgdx