Quote from: Snarky on Thu 30/03/2017 09:23:12Read my post more carefully, it IS easier when you can store the mapping in an external data file and you only need to have a for loop instead of hundred lines of codes. Also, IMO using well defined numerical indices is much less error prone than names, as long as you have good planning you can manage this easier, but to each his own, I wouldn't argue on this aspect. Also, I already mentioned I actually don't need this kind of mappings myself as I don't need multiple lists of different orders. It's because CW mentioned multiple lists that I explain why it is easier to manage with numbers instead of names. If there is only one list you don't even need to do anything in the script to remap everything.
Hold on! Your second, "easy" example is just the same as the first, except worse because it uses cryptic numbers instead of transparent names.
Quote from: Monsieur OUXX on Thu 30/03/2017 10:56:08I've already posted an example in how to choose the appropriate sprites for use in a tile map. This is what I am really doing in my game, but I was just to lazy to dig up the actual codes and show the actual formulae, etc. Also, personally I don't write modules often, as I'd rather put everything in one place, so when I want to reuse codes I just copy-paste codes from one project to another and make necessary modifications to them to more match the new project's need.
Could you give an accurate example of such use? A module you made, maybe?