Edge Detection
After yesterday I am trying to get the edge detection to work.
Turns out the algorithm gets stuck on a group of four tiles.
Basically walking in circles.
However after coming up with a seemingly simple solution, it got even worse.
Now the algorithm is getting stuck on the first tile that it finds. It’s designed to find one tile that is an edge, set by the previous loop. Then it tries to chain those edge tiles, starting from that found tile. This way we create the normals and other collision information we need. However the simple added check is not working well with the rest of the checks. Therefore it won’t be able to proceed, even though the loop before it thought it had found a valid tile.
I think I need to clean up that code part a bit. Making more concrete what a valid tile is and putting that in a function. This way there is one way to check a tile and not three separate ways. That should at least help point out where the real problem is. Since basically all the tile checks could be wrong now.