Hi. You might have seen my previous thread. If not, I am trying to create a multiplayer pong-like game (the 2 player-same device option on the glow hockey app would be a great example of what I'm trying to create only in the form of pong) and I need to figure out how to detect multiple touches without interfering with one another (or you can go to this link:
http://www.iphonedevsdk.com/forum/ip...tyle-game.html). I don't want player 1 to have to lift there finger in order for player 2 to be able to move their paddle. I want them to be completely separate touches. This is what I have so far:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent*)event {
UITouch *touchPlayer1 = [[event allTouches] anyObject];
UITouch *touchPlayer2 = [[event allTouches] anyObject];
CGPoint locationOfPlayer1 = [touchPlayer1 locationInView:touchPlayer1.view];
CGPoint locationOfPlayer2 = [touchPlayer2 locationInView:touchPlayer2.view];
CGPoint xPlayer1Location = CGPointMake(locationOfPlayer1.x,player1.center.y);
CGPoint xPlayer2Location = CGPointMake(locationOfPlayer2.x,player2.center.y);
if(locationOfPlayer1.y > 240) {
player1.center = xPlayer1Location;
}
if(locationOfPlayer2.y < 240) {
player2Multiplayer.center = xPlayer2Location;
}
}