My next game uses two touches at the same time for player & weapon controls. To fire the secondary weapon, I'm using double tap. It works great if the only touch on screen is the double tap. However, when there's another touch on screen, the double tap isn't registered.
A code sample is below that should set a label text to "double tap!" when the tapcount is more than 1. This works fine if there is only one touch, but not with more than that.
[code]
- (BOOL)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSSet *allTouches = [event allTouches]; // <--this gets all the current touches
for (UITouch *touch in allTouches) {
if (touch.tapCount > 1) [label setString:[NSString stringWithFormat:@"double tap!"]];
}
}
[/code]
Any ideas?