Miniscoggs Posted August 11, 2014 Share Posted August 11, 2014 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 More sharing options...
lewster32 Posted August 12, 2014 Share Posted August 12, 2014 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 More sharing options...
Recommended Posts