I don't use static variables that often.
I had the understanding that static variables inside methods would be reset when the class reloads.
I'm using a variable like this:
static BOOL flag = NO;
if( crap_happens ) flag = YES;
When I replace the scene like this:
CCTransitionScene *scene = [CCTransitionFlipX transitionWithDuration:1.5 scene:[GameOverScene scene]];
[[CCDirector sharedDirector] replaceScene:scene];
Then a few moments later come back to the original scene:
CCTransitionScene *scene = [CCTransitionFlipX transitionWithDuration:1.5 scene:[GameScene scene]];
[[CCDirector sharedDirector] replaceScene:scene];
The BOOL value is still YES. Why is this? And is there a better way to reset when the scene is replaced? Must I use class variables instead?