How come I can't use sceneWithSize:
inside a switch statement? If I create an object of my new game scene outside the switch case it works fine? But I\m switching game scenes depending on which spriteNode
the user selected. Why is this happening and is there an alternative method to do what I'm trying to do?
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
/* Called when a touch begins */
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInNode:self];
SKNode *node = [self nodeAtPoint:location];
NSLog(@"Level Selected: %@", node.name);
int x = [node.name intValue];
switch (x) {
case 1:
// if I move this code outside the switch statement it works?
LevelOne *newscene = [LevelOne sceneWithSize:self.size]; // here is where I get an expected expression error?
//[self.view presentScene:newscene transition:[SKTransition doorsOpenVerticalWithDuration:1]];
break;
default:
break;
}
}