Jump to content

Add assets to load during create()


xompl
 Share

Recommended Posts

Hi,

 

I was trying to minimize the total loading time so I wanted to load some assets such as the credits music in background during the game.

 

What I did is to add the assets to the queue during of the main meni create() instead of during the preload state. I had to start the loader myself.

 

 

      this.game.load.audio('music_credits', ['assets/music_credits.mp3', 'assets/music_credits.ogg']);
      this.load.start();

 

This totally works, it loads the music in parallel with the main menu execution and later I can play it in the credits state but I get the following

console errors when I execute the start():

 

Chrome:

Uncaught TypeError: Cannot read property 'x' of null

 

Firefox:

TypeError: this._frame is null

 

Am I doing it wrong? Any sugestion?

 

Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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