Jump to content

Add assets to load during create()


Recommended Posts



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 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():



Uncaught TypeError: Cannot read property 'x' of null



TypeError: this._frame is null


Am I doing it wrong? Any sugestion?



Link to comment
Share on other sites


  • Recently Browsing   0 members

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