Jump to content

Dont understand how to preload preloader


nmindiedev
 Share

Recommended Posts

I'm new to Phaser and I like it. It has everything I need to make a new html5 game quickly but there is a problem:

In the examples provided there is no any preloader example.

 

All we know that preloader must have it's resources preloaded in order to display some kind of beautiful background or animation while loading the rest of data.

I've tried adding onLoadComplete listener and then, when preloader resources got downloaded, there is no hope on loading the game data. GameInstance.loader just shuts down and never invokes even after reset();

I suppose there are some state changing mechanisms for that, but I would like to avoid those deeps. 

 

There is no documentation on that and I ask you to help me with that weird situation.

Link to comment
Share on other sites

The data is loaded in boot for the preloader. It goes in order so if you wanted to add backdrops and loader bars you'd do the initial image loading in boot, then you'd crop and animate in the preloader itself.

If you look in the source in the resources there is a basic template with code already in it for preloading images and image bars. Also another VERY worthy thing to use is Yeoman.

You can have a modular file set up and it constructs the basics of a state set up but then exports it (like compiling) to a single game file.

Credits to Codevinsky for this:

http://www.html5gamedevs.com/topic/5127-generator-phaser-official-yeoman-generator-for-phaser-projects/

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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