I'm making a level editor/creator and I'd like to know if somebody knows how to make an object sense if their is an object (the same object) above it, below it, etc. So it can make the corners of the tile automatically (by changing the direction of the object which will have all the different corner types). I've tried looping it, but I failed. Any suggestions/methods?
Interesting question and approach of using the directions from a tile as a tile state. It sounds a lot like horizontally or vertically flipping a tile in the editor.
A basic way for a tile editor is to have a tile corresponding to a tile number, the number <-> tile connection. You will be having multiple tiles, if I am correct, and multiple states for that tile. So you need to save the tile state in this case too, not just the number.
And with tile state I actually mean the set rotation/direction in this case. If a small tile map is like this:
1 1 1
1 0 1
1 0 1
Then you could try to add a delimiter for the direction of the tile, like this:
1:1 1:0 1:2
1:0 0:0 1:0
1:0 0:0 1:0
Where:
0:0 is an empty spot,
1:0 is regular wall,
1:1 is cornered wall for the top left position
1:2 is cornered wall for the top right position.