在 SKScene 游戏场景中,我分配了场景,但它有一条错误消息No visible @interface with 'SKScene' declares the selector alloc.
我认为这意味着我没有在我的界面中声明它??更正请。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInNode:self];
SKNode *node = [self nodeAtPoint:location];
// if play button touched, start transition to next scene
if ([node.name isEqualToString:@"play"]) {
NSLog(@"play pressed");
SKScene *GameScene = [[GameScene alloc] initWithSize:self.size];
SKTransition *flip = [SKTransition flipVerticalWithDuration:1.0];
[self.view presentScene:GameScene transition:flip];
}
}