我在 cocos2d 中开发一个游戏,其中两个人同时在不同的地方点击屏幕,每次点击算作不同的动作?
这是我当前的代码,它不允许同时计算两个水龙头:
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *myTouch = [touches anyObject];
CGPoint point = [myTouch locationInView:[myTouch view]];
point = [[CCDirector sharedDirector] convertToGL:point];
if (point.y > 512) {
score += 1;
[scoreLabel setString:[NSString stringWithFormat:@"%i", score]];
}
if (point.y < 512) {
score2 += 1;
[scoreLabel2 setString:[NSString stringWithFormat:@"%i", score2]];
}