What do you mean by “return value”? Is this in Tiled, or in a game engine? If it’s an engine, please specify which one. If this is in Tiled, then unless I’ve misunderstood what you want, it sounds like you’re trying to make gameplay in Tiled, which is not possible.
In-engine, the geneeral procedure for things like this:
- Every time the submarine changes position, check the tile(s) it overlaps.
- Read their “murs” property*.
- If “oui”, print “HIT”.
- The way to do read the property depends on your engine and how it interprets the data from your Tiled file. If it leaves the tile IDs and the tile list intact in memory, then you could look up the tile ID and read its properties there. If not, then you will need to add code that runs whenever the map is read to keep the data you want to keep, perhaps in a separate “murs” boolean array (true/false). It’s also possible that they keep the custom properties in some other way, depending on the engine/importer. Either way, this is something you need to figure out in your engine/import plugin, not in Tiled.
Since it looks like this is meant to just be collision (going by the property name “murs”, walls)
If you’re using something like SuperTiled2Unity or another pre-built plugin for your engine of choice, then why not use their built-in support for Tiled’s collision features? If you add a whole-tile collision block to each tile that’s meant to be collision, then you don’t need custom properties, and most plugins will take care of the result using the engine’s native collision features.
To edit collision, open up your tileset (click the wrench icon underneath the tile palette) and click the icon right between the Terrain tool and the Wang Sets tool:
This will open up an editor that lets you draw polygons on the currently selected tile. So, pick a tile you want to be a wall, then click the “Draw Rectangle tool”:
And draw a rectangle spanning the entire tile. Repeat this for your other “wall” tiles.