Hi Axeman,
I think I am not as experienced as you are with tile maps. Can you explain it in more detail or if you don't mind, can you share the code?
I felt like I needed to change something in the editor but I was not sure.
I think I am not as experienced as you are with tile maps. Can you explain it in more detail or if you don't mind, can you share the code?
I felt like I needed to change something in the editor but I was not sure.
I was using Tiled as my tilemap editor. I right clicked my tile representing my wall and set tile properties for that specific tile. Notice I´m not setting the property for the layer or anything in the map: I´m using the specific tile. That way all tiles on the map have the same property. I had a property name "checkCollision", since different tiles reacted differently to collision. Walls were solid and Conveyor belt sped up the entity checking for collision.
Anyway, in my levelloader I wrote something like this:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | int tileHeight = 32; |
Note that this code is based on the old TiledMap API in LibGDX, but I figured it might be easier to read in code...
So basically I read the tilemap and check each tile if it has the property name "CheckCollision". If it returns the property value "solid" I create a new wall with position and tilesize and store it in the list.






