Tag: 飞扬鸟克隆

停止SKSpriteKit点击冲动

我试图在我的游戏中创build一个暂停button。 在你点击屏幕的时候,它会在移动器spriteNode上施加一个冲动。 问题是,当我点击暂停button时,它仍然应用冲动。 我怎样才能创build一个暂停button,而不创build冲动也。 我试着改变if语句,如果然后做最后的冲动部分的其他部分,但这不会工作。 touchBegan方法: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInNode:self]; SKNode *node = [self nodeAtPoint:location]; //if fire button touched, bring the rain if ([node.name isEqualToString:@"repeat"]) { SKTransition *reveal = [SKTransition fadeWithDuration:2.0 ]; MyScene *newScene = [[MyScene alloc] initWithSize: CGSizeMake(self.size.width,self.size.height)]; // Optionally, insert code to […]