I have an issue with CCActionMoveBy when I call the movement action for many of my sprites. I need to move to a certain position and then remove it from the scene.

My problem is If the call the action for one or two positions its working fine, but when I call this action for more than 5 positions, the sprite doesn't move to the correct position.

My Frames are between 15 and 20, and I am not sure If there is a correlation.

Here is my Code :

[_sprite1[1][1] runAction:[CCActionSequence actions:[self moveWithPosition:ccp(60,-10)], remove, nil]];
[_sprite2[1][1] runAction:[CCActionSequence actions:[self moveWithPosition:ccp(10, 80)], remove, nil]];
[_sprite3[1][1] runAction:[CCActionSequence actions:[self moveWithPosition:ccp(-10,- 80)], remove, nil]];
[_sprite4[1][1] runAction:[CCActionSequence actions:[self moveWithPosition:ccp(-60, 10)], remove, nil]];

the above code is calling action for sprite with its position[1][1] like that i am calling many of the position at a same time for sprite.

Here the method for CCActionMoveBy

-(CCActionMoveBy *) moveWithPosition:(CGPoint) distance{

    return [CCActionMoveBy actionWithDuration:MoveTime position:ccp(distance.x, distance.y)];

MoveTime = 0.25f;

if you need more information i will update please help on this issue..


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.