I have an update method that is called every frame. Each update, it adds its deltaTime on to a variable.
If I pause CCDirector and after a while I resume it, will the deltaTime in that scheduled method be massive?
I ask because I am tracking down a bug where on some devices the player can press the home button on an iOS device and then after some time resume the app and the variable that holds their totalGameTime has still been added on as if the game hasn’t been paused.
I was under the impression this shouldn’t happen when I use cocos2d schedulers.
The code for anyone who feels they need it
//[self schedule:@selector(myUpdate:)];
float totalGameTime
-(void) myUpdate:(ccTime) dt {
totalGameTime += (float) dt;
}
I’ve noticed this happen too but only in release. I fixed it by adding:
to my
-(void) applicationDidBecomeActive:(UIApplication *)applicationThis may perhaps be a bug in version 2.0 as I don’t remember this happening prior to this version.