Code:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
for(newBall in enemies)
{
newBall.center = CGPointMake(location.x,location.y);
}
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
for(newBall in enemies)
{
newBall.center = CGPointMake(location.x,location.y);
}
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
for(newBall in enemies)
{
newBall.center = CGPointMake(location.x,location.y);
}
}
That's what I have now. It works, and it moves them to the touchpoint when released, but it moves all of them.