Jump to content

Load a sprite twice?


WeirdestBoy
 Share

Recommended Posts

Hi everyone!

I'm new in the Phaser world. I'm developing a game with some states ("lands" in the game), each state has its own "loader" (I mean, before the "land" starts, all its images, sounds, etc. are loaded in a special state).

So, I have the states:

- State1 and its State1Loader

- State2 and its State2Loader

And when the user want to play the State2, first it's called State2Loader.


The point is that I don't know what state want to play the user, so, I need that all states start with its loader, but my question is: If I load twice (or three times) an image (with the same name and file) I will consume memory for the two images? or Phaser only going to load one image?

Or, is there any way to know that an state already exists? (in that way, before loading the images again, I can prove whether the state exists and avoid load the images twice)

I hope you understand because I don't speak english very well.

Thank you!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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