Preload assets with Sprite Suite

If you are looking for preloading assets, images, audio, SKTextures, etc. in the Sprite Kit game, it’s enough to preload on a strong iVar so that assets are cached by iOS for the future, and then just let the game pull them out of the cache behind the scenes. Or ... is it better to load assets into strong iVars in a singleton, which can be directly accessed anywhere in the game?

+4
source share
2 answers

If you use tools, you can see how much spritekit really caches (that's a lot). Therefore, I do not think that you will see an increase in productivity by using Singleton to store your assets. With that being said, I'm still using singleton for ease of programming and hot-swapping things like fonts and textures.

You will see the biggest productivity gains in:

  • Using texture atlases
  • Without using apples, it is recommended to use the "find nodes by name" method, but using their own arrays or ivars to find them. Personally, I have never used NSHashTable (I'm on osx) and NSMapTable as much as I did after running spritekit.
+3
source

, / SpriteKit , Apple Adventure . , , .

+4

All Articles