I'm sorry if this question has been previously answered, but I was unable to find an answer here or through google. I'm trying to make a simple roguelike-like that would feature a top-down tile map, a player, AI controlled enemies, and various items. I'm having trouble understanding how I can properly have the tilemap interact with the player and enemies through both collision detection and rendering.
It seems that the two main options for collision detection are 1)to specify if a tile is collidable in Tiled Map Editor, and then check tile by tile in the game code to see if the player's position overlaps that of a nearby collidable tile, or 2)integrate the tilemap with box2d physics. Admittedly, I do not understand any part of using tilemaps with box2d.
Additionally, I am unsure of how to properly draw the tilemap in reference to the player and enemies. Say I had a tree tile that I would like to always draw on top of/in front of the player. What is the best practice for accomplishing this in libgdx? I was thinking assign such tiles a certain ID and then render them after the player is rendered.