Jump to content

Miniscoggs
 Share

Recommended Posts

Hi,

 

I've recently started work on a platformer where level information is stored in json files. However I can't see a way to load all the files nessecary without having multiple states. Essentially my issue is that I have a Level Data file which, amoungst other things, contains the filename of a tilemap file, this tilemap file contains the filename of the tile image. I need all these files before the game itself can start. Is there a way in phaser to seqentially load these files, ideally in the preloader phase of a state?

 

If I haven't made this clear enough please ask questions.

 

Thanks,

 

Miniscoggs

Link to comment
Share on other sites

Using states is the cleanest way to do this. You'd load all of your prerequisites in the previous state, and then they'd be accessible in the next state's preload phase so you can read in your filenames and preload those. Ideally you'd preload all of your data that points to assets in the very first 'Boot' state, then you can load any other assets as necessary for the state you're currently in.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...