0
    SKSpriteNode *play = (SKSpriteNode*)[self childNodeWithName:@"play"];
    CGPoint location = [touch locationInNode:self];

    if([play containsPoint:location])
    {
        SKScene *PlaneScene =[[abMyScene alloc]initWithSize:self.size];
        SKTransition *fade = [SKTransition fadeWithDuration:1.0];
        [self.view presentScene:PlaneScene transition:fade];
    }

It's taking about 5 seconds to load the game when I click on the play button. But when the game is over and the menu page is back, it loads quickly. What do I do?

maelswarm
  • 1,163
  • 4
  • 18
  • 37
  • Do you have any intensive operation that happen when you create the scene? In its init, or similar? – Mick MacCallum May 03 '14 at 14:26
  • it loads a lot of images, like background and other objects (6-7 sprite nodes) – user3529575 May 03 '14 at 15:33
  • 2
    You need to preload your sktextures into memory. https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Sprites/Sprites.html#//apple_ref/doc/uid/TP40013043-CH9-SW21 – maelswarm May 03 '14 at 18:23
  • Add a loader in your game which waits while the application preloads. – ZeMoon May 03 '14 at 20:36
  • Another thing, all of a sudden, after adding a node on the main menu page, the play button started working properly, can't find any reason why it did. – user3529575 May 04 '14 at 08:36

0 Answers0