Reputation: 75
Actions don't run in this code:
SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight];
NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;
[self.scene.view presentScene: start transition: reveal];
If i comment NewYork switching they work.
Upvotes: 0
Views: 688
Reputation: 6079
the problem to action *moveLeft / *moveRight, its because start immediately the transition to NewYork scene, so you should wait that *moveLeft / *moveRight is finished like this:
SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight completion:^{
NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;
[self.view presentScene:start transition:reveal];
}];
Upvotes: 3