08-16-2021, 05:33 PM
Hey there, nice job
I had a look at your Github repo and I would suggest the following:
In your tiling implementation (https://github.com/YukkiTimmy/Tilemap2Ti...gd#L51-L64), why not use a dictionary/hashtable to ensure you have unique tiles instead of a nested loop? Using a dictionary will get you an O(N) algorithm (since dictionary lookup is almost always constant time), whereas in the case of your nested loop, you'll have to compare a tile against all others in the worst case.
I had a look at your Github repo and I would suggest the following:
In your tiling implementation (https://github.com/YukkiTimmy/Tilemap2Ti...gd#L51-L64), why not use a dictionary/hashtable to ensure you have unique tiles instead of a nested loop? Using a dictionary will get you an O(N) algorithm (since dictionary lookup is almost always constant time), whereas in the case of your nested loop, you'll have to compare a tile against all others in the worst case.