So what I am trying to do is use a holder (the SKSpriteNode *sprite) and load from a set of three sprites: coral water base.
What I intend to do is based on previously created NSMutableArrays, draw that particular texture at positions across the iPad screen so that, for instance:
at position 1,6: water at position 5,18: coral.
The problem that is happening is that it is only drawing one texture and no others. Is there any fix for this? Should I go about this a different way?
// Load the sprites
SKSpriteNode *sprite;
TerrainType ter;
for (int i = 0; i < numberOfRows; i++)
{
innerArray = [terrainArray objectAtIndex:i];
for (int j = 0; j < rowLength; j++)
{
ter = [[innerArray objectAtIndex:j] intValue];
sprite = [[SKSpriteNode alloc] init];
switch (ter)
{
case base1:
sprite = [SKSpriteNode spriteNodeWithImageNamed:@"MidBase"];
break;
case base2:
sprite = [SKSpriteNode spriteNodeWithImageNamed:@"MidBase"];
break;
case coral:
sprite = [SKSpriteNode spriteNodeWithImageNamed:@"Coral"];
break;
default:
sprite = [SKSpriteNode spriteNodeWithImageNamed:@"PureWater"];
break;
}
sprite.position = CGPointMake(rowLength + width30, numberOfRows + height30);
[self addChild:sprite];
}
}