Hynx Posted February 3, 2014 Share Posted February 3, 2014 I have a project that I've been working over the past week, and basically it is like this: Intro screen with a menuMain game Gameover screen When start the page it loads the files for intro screen, when I click start it loads again for the files for the main game, and when I lose and try again it loads all again for the main game. Is there a way to load everything at once so I don't have these loads between states? Link to comment Share on other sites More sharing options...
XekeDeath Posted February 3, 2014 Share Posted February 3, 2014 Indeed there is!Rich, our benevolent overlord, refers to a Boot State, in which preloader assets are loaded, and a Preloader State, in which all other assets are loaded.There is even a basic template that you can look at and use that has these set up already.... somewhere... I can never remember which folder it is in.... Ah, here it is: phaser\resources\Project Templates\Basic Essentially, all you need to do is add two more states to your existing list, and fill in the blanks in the template files. plicatibu and Heppell08 2 Link to comment Share on other sites More sharing options...
jcs Posted February 3, 2014 Share Posted February 3, 2014 FYI, you can actually load any assets in any state; Phaser gives you the freedom to handle this however you should so desire. if you wanted, you could load every asset for the game before your intro screen. (but loading like this makes it more difficult - though not impossible - to present a nice "loading" UI, so having at least a 'preloader' state that loads your assets for said UI - progress bar graphic etc - usually makes sense). loading assets for particular states makes sense as a game grows larger and when those assets are only needed for a particular state. and of course xekedeath's suggestion of using the template is a good one - after all, that's what it's there for! Hynx and plicatibu 2 Link to comment Share on other sites More sharing options...
Hynx Posted February 3, 2014 Author Share Posted February 3, 2014 Indeed there is!Rich, our benevolent overlord, refers to a Boot State, in which preloader assets are loaded, and a Preloader State, in which all other assets are loaded.There is even a basic template that you can look at and use that has these set up already.... somewhere... I can never remember which folder it is in.... Ah, here it is: phaser\resources\Project Templates\Basic Essentially, all you need to do is add two more states to your existing list, and fill in the blanks in the template files.Wow, thanks a million, I'm still a noob on this and I'm rushing for the Candy Jam. Thanks! Link to comment Share on other sites More sharing options...
XekeDeath Posted February 3, 2014 Share Posted February 3, 2014 Candy Jam..? Damn, if I had known about that earlier, I would have made Bubble Candy Witch Crush Saga, a Bejewelled/Bust-a-move mash up where you shoot candy from the bottom of the screen into the candy at the top, and then you can swap them around to match 3...! Link to comment Share on other sites More sharing options...
Recommended Posts