How to add a Get Ready screen in spritekit

94 views Asked by At

Hi I want to add a title or label that says Get Ready and when you tap it you start spawning custom sprites. Does any one know how to do this. As a reference I want the Get ready screen to act like Flappy Birds or Splashy Fish. Anywhere I can get info on this?

2

There are 2 answers

0
jseanj On
SKSpriteNode *getReady = [SKSpriteNode spriteNodeWithImageNamed:@"myImage.png"];
//remember to set position and other custom stuff here
[self addChild:getReady];
_isFirst = YES; //BOOL property 

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (_isFirst)
    {
        SKAction *fadeOut = [SKAction fadeOutWithDuration:10];
        [getReady runAction:fadeOut];
        _isFirst = NO;
    } else {
        //other time you tap, code here
    }
}
2
Pedro Nadolny On

You need to creat a SKSpriteNode with the image you want and add to your scene.

SKSpriteNode *getReady = [SKSpriteNode spriteNodeWithImageNamed:@"myImage.png"];
//remember to set position and other custom stuff here
[self addChild:getReady];

Then when the user tap you can run an action to fade it out.

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    SKAction *fadeOut = [SKAction fadeOutWithDuration:10];
    [getReady runAction:fadeOut];
}

Also, I think you would be great if you check out some tutorials, cause that's really basic stuff. I'm sure you can easily find then.