How do i move multiple objects in cocos2d, i have imported all my sprites from level helper as CCSprites and b2Bodies. When i use this code only one character is dragged and all the others disappear, why? I am creating an iPhone app.
Thanks
-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
[self ccTouchesMoved:touches withEvent:event];
}
-(void) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch =[touches anyObject];
CGPoint point = [touch locationInView:[touch view]];
point = [[CCDirector sharedDirector]convertToGL:point];
greenman.position = ccp(point.x, point.y);
greenman1.position = ccp(point.x, point.y);
greenman2.position = ccp(point.x, point.y);
greenman3.position = ccp(point.x, point.y);
greenman4.position = ccp(point.x, point.y);
blueman.position = ccp(point.x, point.y);
blueman1.position = ccp(point.x, point.y);
blueman2.position = ccp(point.x, point.y);
blueman3.position = ccp(point.x, point.y);
blueman4.position = ccp(point.x, point.y);
}