Hi there!
I'm working in a Cocos2D project that uses the accelerometer inside the game itself (in the "GameScene" class, that inherits from the CCLayer). The accelerometer used to work great, but suddenly with no logical reason it disappeared... I've searched for my last movement and I've found a really really strange thing: when from within the menu scene I simply replace the scene by the game scene the accelerometer works well, however when I replace it with a transition the accelerometer works until the transition is finished, then it becomes inactive:
Code:
// From within the MenuScene:
Game *layer = [Game node];
layer.currentMap = level;
layer.sound = sound;
[layer updateLevel];
// With this line the accelerometer works well
[[CCDirector sharedDirector] replaceScene:(CCScene*)layer];
// However with this one it works until the transaction is over (I've logged the accelerometer and it logs until the transition ends)
//[[CCDirector sharedDirector] replaceScene:[CCZoomFlipAngularTransition transitionWithDuration:0.5 scene:(CCScene*)layer]];
Why is this happening? There's something about transitions that I should know and I don't?
Thanks in advance!