n'tMy game scene is run from a level selection scene using replaceScene and and a level number is passed in. The game layer loads data from a plist and then creates objects in in the world space (CCSprite subclass with box2d bodies). The hero character remains in the center of the screen while the level is played - I adjust layer position to do this along with layer scale to zoom in and out based on the speed of movement.
For example:
CGPoint layerPosition = ccp(((screenSize.width / 2) - ourHero.position.x) * sceneScale, ((screenSize.height / 2) - ourHero.position.y) * sceneScale);
[self setPosition:layerPosition];
[self setScale:sceneScale];
The problem is, the first time the level runs movement can often be jerky when speed increases and the layer zooms out (not just for a few seconds at the start). However, if the user restarts the level (button executes replaceScene) the movement of the replacement level is perfectly smooth, even at speed.
I am using a batchnode and have the sprite images stored in a frame cache. I have tried setting up the frame cache and preloading sounds in the level selection scene, but that doesn't make any difference. I have event tried purging the cache between levels to see if I can make the restarted level exhibit the same behavior, but that didn't do anything.
Can anyone suggest what might cause this and how I might be able to eliminate it.
Thanks!