We have assembled most of the "external" components, so it is time to turn our attention to the CLPlayfieldLayer
class itself. Let's dive into the class instantiation and init
methods first.
+(id) gameWithRemoteGame:(BOOL)isRemoteGame { return [[[self alloc] initWithRemoteGame:isRemoteGame] autorelease]; } -(id) initWithRemoteGame:(BOOL)isRemoteGame { if(self = [super init]) { size = [[CCDirector sharedDirector] winSize]; // Load the spritesheet [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"cyclesheet.plist"]; cyclesheet = [CCSpriteBatchNode batchNodeWithFile:@"cyclesheet.png"]; // Add the batch node to the layer [self addChild:cyclesheet z:1]; bikeWalls = [[NSMutableArray alloc] init]; remoteGame = isRemoteGame; isGameOver = NO; isTouchBlocked = NO; // Build the background...