Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pre loading assets with Sprite Kit

When looking to preload assets, images, audio, SKTextures etc. within a Sprite Kit game is it enough to preload to a strong iVar so that the assets are cached by iOS for the future and then just letting the game pull them from the cache behind the scenes. Or ... is it best to load the assets to strong iVars in a singleton that can be directly accessed anywhere within the game?

like image 946
fuzzygoat Avatar asked Mar 21 '23 12:03

fuzzygoat


1 Answers

I'm not sure if/how SpriteKit caches the resources behind the scenes, but the Apple Adventure example game preloads assets to static variables. So I'd probably follow their lead.

like image 127
Janis Kirsteins Avatar answered May 07 '23 16:05

Janis Kirsteins