8 years ago by Arturo
A while ago, I had a problem with impact, which I was able to resolve.
The problem was, that I was using big images for the backgrounds, and the more that I play the game, the more than the cache was full, and at some point, the images wasnt loaded anymore.
http://impactjs.com/forums/help/impact-doesnt-load-the-images-anymore-after-some-levels-using-big-full-images-for-the-background
You can see on the link what I did in the end: Everytime that I load a new level, I remove every image in cache of the level before (in cache will never save this images of background, and will load only when the level is loaded).
I wasnt sure if that was the right solution, but I got it working so far without problem.
Until now. If I play the game and then I return to some of the first levels after a while, the system works... the problem is that for some reasons the levels take a little bit longer than before to load, so there is a moment where you control the character in an empty canvas...
My question: is there a way to know when all the images has been loaded? Like this I could put a loading icon, until I get everything working
Thanks!
The problem was, that I was using big images for the backgrounds, and the more that I play the game, the more than the cache was full, and at some point, the images wasnt loaded anymore.
http://impactjs.com/forums/help/impact-doesnt-load-the-images-anymore-after-some-levels-using-big-full-images-for-the-background
You can see on the link what I did in the end: Everytime that I load a new level, I remove every image in cache of the level before (in cache will never save this images of background, and will load only when the level is loaded).
I wasnt sure if that was the right solution, but I got it working so far without problem.
Until now. If I play the game and then I return to some of the first levels after a while, the system works... the problem is that for some reasons the levels take a little bit longer than before to load, so there is a moment where you control the character in an empty canvas...
My question: is there a way to know when all the images has been loaded? Like this I could put a loading icon, until I get everything working
Thanks!