0
votes

I'm building a cocos2d game where I use two background sprites, actually one is a sprite, the other one is a CCMask that is used to make holes into the other background, but the performance problem is the same even when using 2 regular background sprites on top of each other.

When I use one background sprite, my FPS is around 60 all the time, when I use two background sprites the FPS drops to 30 every time. I've googled around, tried different solutions including reading sprites from a sprite frame cash instead of from a file, unfortunately the result is the same.

I just can't figure out why this is happening. Does any one here have any idea why this is happening and how to get around it?

1

1 Answers

2
votes

On older devices (1st & 2nd generation, ie iPhone 3G) this can easily happen since they have terrible fillrates.

If possible try to SpriteBatch the two background images. You need to add both to a texture atlas, for example with TexturePacker. Sprite batching is particularly effective if the sprites are large.

Also, just in case: don't test performance in the Simulator. Simulator performance has no relation to actual device performance whatsoever.