We will start by creating the Tutorial
class, which will display a message on the centre of the screen. This message can be in any text you want and can be displayed any time you want to display it. Once the player has read it, he can dismiss it by touching it.
The following is the
Tutorial.h
file:#import <Foundation/Foundation.h> #import "cocos2d.h" #import "GameScene.h" @interface Tutorial : CCNode { GameLayer * theGame; touchState state; CCSprite * back; CCLabel * label; } @property(readwrite,nonatomic) touchState state; @property(nonatomic,retain) GameLayer * theGame; @property(nonatomic,retain) CCSprite * back; @property(nonatomic,retain) CCLabel * label; -(id)initWithText:(NSString *)text theGame:(GameLayer *)game; @end
The following is the
Tutorial.m
file:#import "Tutorial.h" @implementation Tutorial @synthesize state,theGame,back,label; -(id)initWithText:(NSString *)text theGame:(GameLayer *)game { if ((self = [super...