I am writing a game using Swift and SpriteKit. the game mechanics are not the issue. the problem is the “maze” is stored as a ASCII text file using “#” to denote walls. The first version simply replaced each “#” with a single sprite which looks like this
I want a more fluid display that looks more like this
the way I am doing this is by analyzing all the “neighbors” of a given “#” and coverting that to a number between 0 and 255. The based on that number, choosing the correct wall sprite.
This is working quite well , but I the only way I can achieve a smooth image is using 45 different sprites. However it seems all the existing programs use only 16. I can’t figure how those handle all the diverse corner patterns. And I can’t find any “code” examples that show how it might be done