2012-01-09 15 views
0

私は下から上に産んでいるスプライトを持っています。彼らはランダムに来て、私はスプライトシートを使用していない。問題は、下から上への移動中にちらつくことです。どうすればこの問題を克服できますか?私はcocos2d 1.0.1を使用しています。助けてくれてありがとう。cocos2dのスプライトのちらつき(振動)問題

//私はFPSを増加し、スプライトの動きが滑らかであった場合appdelegateでX軸

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]]; 
+0

スプライトの移動にいくつかのコードを表示する必要があります – samfisher

+0

いくつかのコードを追加しました。 –

+0

あなたのコードはどのFPSで動作していますか? –

答えて

1

沿っターゲットを起動することを決定。私は交換しました

[[CCDirector sharedDirector] setAnimationInterval:1.0/60];

[[CCDirector sharedDirector] setAnimationInterval:0.5/60];

関連する問題