- (void)showLevelImage:(NSString *)dataString { [fullImage lockFocus]; // Set the level background [[self colorWithHexRed:0xCA green:0xCA blue:0xD0 alpha:0xFF] set]; NSRectFill(NSMakeRect(0, 0, 792, 600)); // LOAD OBJECT IMAGES IN NSString *objData = [[dataString substringsCapturedByPattern:@"\\|(.+)$"] objectAtIndex:1]; NSArray *allObjects = [objData componentsSeparatedByString:@"!"]; NSString *thisObject; NSArray *directions = [NSArray arrayWithObjects:@"right", @"down", @"left", @"up", nil]; for (int i = 0; i < [allObjects count]; i++) { thisObject = [allObjects objectAtIndex:i]; NSString *thisObjNum = [[thisObject substringsCapturedByPattern:@"^([0-9]+)\\^"] objectAtIndex:1]; NSArray *thisArgs = [[[thisObject substringsCapturedByPattern:@"\\^(.+)$"] objectAtIndex:1] componentsSeparatedByString:@","]; NSImage *thisObjImage; if ([thisObjNum isEqualToString:@"5"]) { // ninja thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"ninja"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"0"]) { // gold thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"gold"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"3"]) { // gauss thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"gauss"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"10"]) { // rocket thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"rocket"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"12"]) { // mine thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"mine"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"4"]) { // floorguard thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"floorguard"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"8"]) { // thwump NSString *thisDir = [directions objectAtIndex:[[thisArgs objectAtIndex:2] intValue]]; thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"thwump%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"6"]) { // drones NSString *thisDir = [directions objectAtIndex:[[thisArgs objectAtIndex:5] intValue]]; if ([[thisArgs objectAtIndex:4] intValue] == 0) { // zap drones if ([[thisArgs objectAtIndex:3] intValue] == 0) { //NSLog(@"Dumb zap"); thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"zap%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([[thisArgs objectAtIndex:3] intValue] == 1) { //NSLog(@"Seeker"); thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"seeker%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 18, 24, 30) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } } else if ([[thisArgs objectAtIndex:4] intValue] == 1) { // laser drones //NSLog(@"Laser"); thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"laser%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([[thisArgs objectAtIndex:4] intValue] == 2) { // chaingun drones //NSLog(@"Chaingun"); thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"chaingun%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } } else if ([thisObjNum isEqualToString:@"1"]) { // bounceblock thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"bounceblock"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([thisObjNum isEqualToString:@"2"]) { // launchpads float hVel = [[thisArgs objectAtIndex:2] floatValue]; float vVel = [[thisArgs objectAtIndex:3] floatValue]; if (hVel == 0 && vVel < 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchup"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (hVel == 0 && vVel > 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchdown"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (vVel == 0 && hVel < 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchleft"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (vVel == 0 && hVel > 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchright"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (hVel > 0 && vVel > 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchdownright"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (hVel > 0 && vVel < 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchupright"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (hVel < 0 && vVel < 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchupleft"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if (hVel < 0 && vVel > 0) { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchdownleft"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else { thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"launchup"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } } else if ([thisObjNum isEqualToString:@"7"]) { // oneway NSString *thisDir = [directions objectAtIndex:[[thisArgs objectAtIndex:2] intValue]]; thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"oneway%@", thisDir]]]; [thisObjImage setFlipped:YES]; // Draw oneways in the same glitchy way N does if ([[thisArgs objectAtIndex:2] intValue] == 2 || [[thisArgs objectAtIndex:2] intValue] == 3) { [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([[thisArgs objectAtIndex:2] intValue] == 0) { [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 11, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else if ([[thisArgs objectAtIndex:2] intValue] == 1) { [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 11, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } } else if ([thisObjNum isEqualToString:@"9"]) { // doors NSString *thisDir;// = [directions objectAtIndex:[[thisArgs objectAtIndex:5] intValue]]; if ([[thisArgs objectAtIndex:2] intValue] == 0) { if ([[thisArgs objectAtIndex:7] intValue] == -1) { thisDir = @"left"; } else { thisDir = @"right"; } } else { if ([[thisArgs objectAtIndex:8] intValue] == -1) { thisDir = @"up"; } else { thisDir = @"down"; } } if ([[thisArgs objectAtIndex:3] intValue] == 0) { // locked or normal if ([[thisArgs objectAtIndex:6] intValue] == 0) { //normal thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"door%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:4] floatValue]*24 - 1, [[thisArgs objectAtIndex:5] floatValue]*24 - 1, 26, 26) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } else { //locked thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:[NSString stringWithFormat:@"lockeddoor%@", thisDir]]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:4] floatValue]*24 - 1, [[thisArgs objectAtIndex:5] floatValue]*24 - 1, 26, 26) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; NSImage *thisSwitchImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"lockeddoorswitch"]]; [thisSwitchImage setFlipped:YES]; [thisSwitchImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; [thisSwitchImage release]; } } else { //trap thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"trapdoorswitch"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 12, [[thisArgs objectAtIndex:1] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; } } else if ([thisObjNum isEqualToString:@"11"]) { // exit thisObjImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"exit"]]; [thisObjImage setFlipped:YES]; [thisObjImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:0] floatValue] - 13, [[thisArgs objectAtIndex:1] floatValue] - 13, 26, 26) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; NSImage *thisSwitchImage = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForImageResource:@"exitswitch"]]; [thisSwitchImage setFlipped:YES]; [thisSwitchImage drawInRect:NSMakeRect([[thisArgs objectAtIndex:2] floatValue] - 12, [[thisArgs objectAtIndex:3] floatValue] - 12, 24, 24) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0]; [thisSwitchImage dealloc]; } [thisObjImage dealloc]; } NSString *thisTile; [[self colorWithHexRed:0x79 green:0x79 blue:0x88 alpha:0xFF] set]; for (int i = 0; i < 31; i++) { for (int j = 0; j < 23; j++) { NSBezierPath *path = [NSBezierPath bezierPath]; thisTile = [dataString substringWithRange:NSMakeRange(23*i+j, 1)]; if ([thisTile isEqualToString:@"1"]) { // E tile path = [NSBezierPath bezierPathWithRect:NSMakeRect(24+24*i, 24+24*j, 24, 24)]; [path fill]; } else if ([thisTile isEqualToString:@"2"]) { // 1-W tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(24, 24)]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"3"]) { // 1-Q tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(-24, 24)]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"4"]) { // 1-A tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(24, 24)]; [path relativeLineToPoint:NSMakePoint(0, -24)]; [path fill]; } else if ([thisTile isEqualToString:@"5"]) { // 1-S tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path relativeLineToPoint:NSMakePoint(-24, 24)]; [path fill]; } else if ([thisTile isEqualToString:@"6"]) { // 4-W tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(48+24*i, 24+24*j) radius:24 startAngle:180 endAngle:90 clockwise:YES]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"7"]) { // 4-Q tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(24+24*i, 24+24*j) radius:24 startAngle:0 endAngle:90]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"8"]) { // 4-A tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(24+24*i, 48+24*j) radius:24 startAngle:270 endAngle:0]; [path relativeLineToPoint:NSMakePoint(0, -24)]; [path fill]; } else if ([thisTile isEqualToString:@"9"]) { // 4-S tile [path moveToPoint:NSMakePoint(24+24*i, 48+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(48+24*i, 48+24*j) radius:24 startAngle:180 endAngle:270]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@":"]) { // 8-W tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(24+24*i, 48+24*j) radius:24 startAngle:270 endAngle:0]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@";"]) { // 8-Q tile [path moveToPoint:NSMakePoint(24+24*i, 48+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(48+24*i, 48+24*j) radius:24 startAngle:180 endAngle:270]; [path relativeLineToPoint:NSMakePoint(0, 24)]; [path fill]; } else if ([thisTile isEqualToString:@"<"]) { // 8-A tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(48+24*i, 24+24*j) radius:24 startAngle:180 endAngle:90 clockwise:YES]; [path relativeLineToPoint:NSMakePoint(0, -24)]; [path fill]; } else if ([thisTile isEqualToString:@"="]) { // 8-S tile [path moveToPoint:NSMakePoint(24+24*i, 48+24*j)]; [path appendBezierPathWithArcWithCenter:NSMakePoint(24+24*i, 24+24*j) radius:24 startAngle:90 endAngle:0 clockwise:YES]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@">"]) { // 3-W tile [path moveToPoint:NSMakePoint(24+24*i, 36+24*j)]; [path relativeLineToPoint:NSMakePoint(24, 12)]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"?"]) { // 3-Q tile [path moveToPoint:NSMakePoint(48+24*i, 36+24*j)]; [path relativeLineToPoint:NSMakePoint(-24, 12)]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"@"]) { // 3-A tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(0, 12)]; [path relativeLineToPoint:NSMakePoint(-24, -12)]; [path fill]; } else if ([thisTile isEqualToString:@"A"]) { // 3-S tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(0, 12)]; [path relativeLineToPoint:NSMakePoint(24, -12)]; [path fill]; } else if ([thisTile isEqualToString:@"B"]) { // 7-W tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(24, 12)]; [path relativeLineToPoint:NSMakePoint(0, 12)]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"C"]) { // 7-Q tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(-24, 12)]; [path relativeLineToPoint:NSMakePoint(0, 12)]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"D"]) { // 7-A tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(0, 12)]; [path relativeLineToPoint:NSMakePoint(24, 12)]; [path relativeLineToPoint:NSMakePoint(0, -24)]; [path fill]; } else if ([thisTile isEqualToString:@"E"]) { // 7-S tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path relativeLineToPoint:NSMakePoint(0, 12)]; [path relativeLineToPoint:NSMakePoint(-24, 12)]; [path fill]; } else if ([thisTile isEqualToString:@"F"]) { // 2-W tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(12, 24)]; [path relativeLineToPoint:NSMakePoint(-12, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"G"]) { // 2-Q tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(-12, 24)]; [path relativeLineToPoint:NSMakePoint(12, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"H"]) { // 2-A tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(-12, 0)]; [path relativeLineToPoint:NSMakePoint(12, 24)]; [path fill]; } else if ([thisTile isEqualToString:@"I"]) { // 2-S tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(12, 0)]; [path relativeLineToPoint:NSMakePoint(-12, 24)]; [path fill]; } else if ([thisTile isEqualToString:@"J"]) { // 6-W tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(12, 0)]; [path relativeLineToPoint:NSMakePoint(12, 24)]; [path relativeLineToPoint:NSMakePoint(-24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"K"]) { // 6-Q tile [path moveToPoint:NSMakePoint(48+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(-12, 0)]; [path relativeLineToPoint:NSMakePoint(-12, 24)]; [path relativeLineToPoint:NSMakePoint(24, 0)]; [path fill]; } else if ([thisTile isEqualToString:@"L"]) { // 6-A tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(12, 24)]; [path relativeLineToPoint:NSMakePoint(12, 0)]; [path relativeLineToPoint:NSMakePoint(0, -24)]; [path fill]; } else if ([thisTile isEqualToString:@"M"]) { // 6-S tile [path moveToPoint:NSMakePoint(24+24*i, 24+24*j)]; [path relativeLineToPoint:NSMakePoint(0, 24)]; [path relativeLineToPoint:NSMakePoint(12, 0)]; [path relativeLineToPoint:NSMakePoint(12, -24)]; [path fill]; } else if ([thisTile isEqualToString:@"N"]) { // 5-A tile path = [NSBezierPath bezierPathWithRect:NSMakeRect(24+24*i, 36+24*j, 24, 12)]; [path fill]; } else if ([thisTile isEqualToString:@"O"]) { // 5-S tile path = [NSBezierPath bezierPathWithRect:NSMakeRect(36+24*i, 24+24*j, 12, 24)]; [path fill]; } else if ([thisTile isEqualToString:@"P"]) { // 5-W tile path = [NSBezierPath bezierPathWithRect:NSMakeRect(24+24*i, 24+24*j, 24, 12)]; [path fill]; } else if ([thisTile isEqualToString:@"Q"]) { // 5-Q tile path = [NSBezierPath bezierPathWithRect:NSMakeRect(24+24*i, 24+24*j, 12, 24)]; [path fill]; } } } [[self colorWithHexRed:0x79 green:0x79 blue:0x88 alpha:0xFF] set]; NSRectFill(NSMakeRect(0, 0, 24, 600)); NSRectFill(NSMakeRect(24, 0, 768, 24)); NSRectFill(NSMakeRect(768, 0, 24, 600)); NSRectFill(NSMakeRect(24, 576, 768, 24)); [fullImage unlockFocus]; [imageView setImage:nil]; [imageView setImage:fullImage]; }