My game has a number of levels. For each level, I need to spawn sprites in various locations. I have created json files for each my levels containing info about which sprites to spawn and their locations. When a level begins, I use its json file to populate an array "LevelData" that the game then reads from to see what to create.
My current logic looks like this:
Global number CurLevel = 1
System | On Start of Layout -> AJAX | Request level1.json(tag "currentleveldata")
AJAX | On "currentleveldata" completed -> LevelData | Load from JSON string AJAX.LastData
This all works fine but I need a way to request not a specific file like level1.json, but instead base the file name off of the level my player is currently on, like level[CurLevel].json. The dialog box for AJAX request is only giving me a drop-down menu to select files. I'm planning to include at least 50 different level setups so I really need a way to call a filename with a variable in it.