Multiple GameScene load

Hi team,

I am using Spritekit to work on a mini game in which new SKScene is presented after player tap to restart on Game Over scene. If this sequence happen fast and often, my phone is getting very hot

I assume it was because Spritekit had to constantly load quite many variables and constants in my GameScene (more than 50 in this game), but I am not really sure.

Generally, what should we do to avoid this kind of issue ? What are the better approach and practice ?

Many thanks

You should really learn to use Instruments to find out what is using so much CPU power and battery.

Are there any assets that are reusable?

Hi Marciokoko,

I just tried using Instrument with Leak and there’s no leak detected during game play
There are just a few small-sized images stored in .xcassets, so I assume it should be fine
Can you tell me more about reuseable assest that you mentioned ? How to load them once when the app run ?

I also tried to
-subclass the objects
-optimize update() function to the best that I can. But it seems to me that it is still not enough because I am using quite a lot of calculation each update loop.

BR