chiuna's Recent Forum Activity

  • try with Ajax request URL : "level"&CurLevel&".json"

    You are a life-safer! thanks for the quick answer!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

chiuna's avatar

chiuna

Member since 20 Aug, 2016

None one is following chiuna yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies