0
votes

I'm new into developing but after searching and didn't able to find specific answers, I wanted to open a thread, if my questions sound beginner, it's normal, I'm completely new into this.

Currently I'm working on a simple project;

I'm using a spritekit scene in every view controller which includes a color sprite with AnimateWithtextures Action. It includes 12 different images so it's a frame by frame animation.

Although I'm having weird performance issue after a while (currently app includes just 3 spritekit scene / 4 view controller) and iphone gets hot quickly. So I assume there's a problem, I have some specific concerns which I can ask;

1 - I started project with single view app template, should I choose game template? (I added import SpriteKit into code and linked spritekit library though, so this shouldn't be a problem)

2 - Could be a wrong choice using color sprite for AnimateWithtextures Action?

3 - I used instruments, there's no leak, cpu usage is mostly over %150 though.

4 - Images are png8, not transparent, frame rate is 12 per second for every animation. Is there anything else I can do for optimization?

5 - I used seperate asset catalog/folder for every view controller/scene. Does this affect anything or not?

Any other questions & suggestions are welcome.

1
3 spritekit scene at the same time? Very unusual! And I doubt it was build for such usage. In general: more intensive animations ==> more intensive CPU usage. You may rethink your way to proceed. - Jean-Baptiste Yunès

1 Answers

0
votes

Aside from my comment:

  1. No problem, templates are just pre-built configs; then customizing any template the way you want is exactly the same.

  2. Interface Builder Color Sprite is just instance of SKSpriteNode exactly what you need for texture animation

  3. My comment suggest that 3 scenes with intensive animations at the same time is probably not the best way to proceed (As you didn't describe your intention more precisely, I can't answer more)

  4. No, except ensure that textures aren't resized too frequently. Size fitting may reduce in some context CPU usage

  5. No effect. It's just a matter of project structuring.