I have sprites which are spawning from bottom to top. They are coming randomly and i haven’t used spritesheet for this. The problem is they flicker during their movement from bottom to top. How can i overcome this problem? I am using cocos2d 1.0.1. Thanks for any help.
// Determine where to spawn the target along the X axis
CGSize winSize = [[CCDirector sharedDirector] winSize];
int minX = target.contentSize.width/2;
// int maxX = winSize.width - target.contentSize.width/2;
// int rangeX = maxX - minX;
int actualX = (arc4random() % 230) + minX;
// Create the target slightly off-screen along the right edge,
// and along a random position along the Y axis as calculated above
target.position = ccp(actualX,-100);
[self addChild:target];
// Determine speed of the target
float minDuration = 4.0;
float maxDuration = 12.0;
float rangeDuration = maxDuration - minDuration;
//int actualDuration = (arc4random() % rangeDuration) + minDuration;
// Create the actions
id actionMove = [CCMoveTo actionWithDuration:rangeDuration position:ccp(actualX,winSize.height+target.contentSize.height)];
[target runAction:[CCSequence actions:actionMove, nil]];
In appdelegate I increased FPS and the sprite movements were smooth. I replaced
[[CCDirector sharedDirector] setAnimationInterval:1.0/60]; with
[[CCDirector sharedDirector] setAnimationInterval:0.5/60];