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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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