Time for action – adding a tutorial to our intro scene
Follow these steps to display hints during the intro:
In
Intro.h
, add an instance variable called message:SPTextField *_message;
Switch to
Intro.m
.Update the initializer with the help of the following code:
[buttonNext addEventListenerForType:SP_EVENT_TYPE_TRIGGERED block:^(id event) { [(SceneDirector *) self.director showScene:@"piratecove"]; }]; SPQuad *quad = [SPQuad quadWithWidth:400.0f height:60.0f color:SP_BLACK]; quad.alpha = 0.8f; quad.x = 16.0f; quad.y = 16.0f; _message = [SPTextField textFieldWithWidth:400.0f height:60.0f text:@"Welcome to the battlefield."]; _message.color = SP_WHITE; _message.x = 16.0f; _message.y = 16.0f; [self addChild:background]; [self addChild:_pirateShip]; [self addChild:_enemyShip]; [self addChild:buttonNext]; [self addChild:quad]; [self addChild:_message];
Update the
reset
method, as shown in the following code:[_pirateShip moveToX:Sparrow.stage.width / 2 andY:(Sparrow.stage.height / 2) - 20.0f...