Hi there!
I'm making a puzzle game that requires lots of levels (around 100 or even more), but all of them have the same basic objects. I could make all the levels manually in different layouts, but it would be much better (and easier) if I could dinamically create levels by reading a .txt file for example, each file for a level. The idea is having only one layout that could handle all stages and loading them using a variable. I tried using AJAX to do this and it works fine, but I can't load a file using a variable's name I guess.
The idea is that I have a "level select" layout, let's say with 3 levels. All the levels go to to the same "game" layout, but setting a global variable when selected. Then, at the start of the "game" layout, I'd use the variable to know which .txt file I'd open (001.txt, 002.txt, 003.txt, etc) and then I'd create the level using the content of the file.
The problem is using the global variable name and opening the correct .txt file. Any ideas? Or better solutions?
Thanks in advance!