this question may have been pretty old, but today I ran into the same problem and I think I found a pretty good solution for it:
In AppDelegate, I do the following:
- (void)applicationDidBecomeActive:(UIApplication *)application { SKView *view = (SKView *)self.window.rootViewController.view; if ([view.scene isKindOfClass:[GameScene class]]) { XGGameScene *scene = (GameScene *)view.scene; [scene resumeGame]; } }
And then in the GameScene class GameScene I update BOOL to reflect that the application has just resumed from the background:
- (void)resumeGame {
And finally, in the update loop: I run the following:
- (void)update:(NSTimeInterval)currentTime {
Hope this helps!
source share