Hello,
I’m almost done with a game and I have some questions to optimized it, I would like to be adviser before starting a changement of my preloading game/managers.
What I’m doing for now is preloading all the images/sprites I will need for my game in the composer create function, putting them not visible and not bodyActive and use a manager to putting them active when needed.
But the thing is I have 1500 images/sprites at once out of screen when I preload them (I don’t know if it’s a lot)
I expose my issue :
- I need to change completely the decor during the game, but removing everything and reloading the whole with new data make a big freeze during this step (not enough smooth, looks logic lol).
What I thought was to use a sprite sheet on everything even for some stuff where I use newImageRect, and swap the image to the correct decor when needed.
The fact is that some elements will be use only later on the game and have no equivalent to be swap and some other elements use at the begining are no longer needed later on the game, so loading all the decor before should use more texture memory and increase my number of sprite(sheet.png and display object) for nothing, at least if the player don’t go far enough.
I was wondering if there is another way to switch to a new decor smoothly and efficiently ? otherwise I would optimzed my game on this way
- excepted the changement of decor everything work fine even with 1500 images loaded at once ( checked with benchmark, using 5-20% of cpu) but when my battery level gone low the performance of my game are discreased a lot.
I suspect the huge amount of images loaded (on and off screen) to be the cause of this problem (I think about use texture manager and use display library to display them to avoid to preload that much of images/sprites but sprite sheet are not allowed for it …), is this already happened to someone ?
I’m open to all discussions/tutorials/advertises/experiences it could help myself, I can be more precise if needed.