We have omitted some small areas of code, specifically those related to the main menu itself. We have built convenience methods to start the game with a specified rule set and a specified control scheme. (If you want to see these in detail, please refer to the code bundle for this chapter.) There's really nothing that we haven't done before in earlier chapters, but we will briefly go over the
initWithControl:andRules:
method of the OPPlayfieldLayer
class, so you can see how we have structured the initialization of the game:
Filename: OPPlayfieldLayer.mm
-(id) initWithControl:(NSString*)controls andRules:(NSString*)gameRules { if(self = [super init]) { size = [[CCDirector sharedDirector] winSize]; // Load the spritesheet [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"poolsheet.plist"]; poolsheet = [CCSpriteBatchNode batchNodeWithFile:@"poolsheet.png"]; ...