How to reference tile collision in my program

(Fudgenuggets1) #1

So I am loving tiled but am still a new guy. I was making maps and then making objects for all the collision points separately from the graphics which is extremely tedious. I found out about the “Tile Collision Editor” and it seems like the extreme time saver! I put the collision on all the tiles I need it on and now I can’t figure out how to use this information in my Python/Pygame program. Previously I wasn’t even needing to get any information out of the layers, just the objects. Since the collision points are properties of individual tiles in a layer I have been having a hard time trying to figure out how to properly do this.

Instead I have been trying to reference each tile in the layer “Walls” for the x and y values. The only info each tile has is a tuple of 3 values and I cannot even figure out what those values are. I would think that two of those values are x and y coordinates but after printing them all out and reading through many of them I have no idea what they are values of.

So I guess my question is: How do I get the x/y coordinates of tiles from a layer to use them as collision points instead of having to use separate objects from an object group? Or how do I use the collision points from the collision editor?