我的問題是,我編碼的精靈。它應該改變它應該從(1,2,3)改變它的圖像。它應該看起來像倒計時開始遊戲。 1,2,3是3 png圖像。但圖像不會以相同的時間間隔顯示。我是指(1 - 2),(2 - 3)之間的時間不一樣。這是隨機的。請幫我解決我的問題。如果有比我更好的解決方案,請幫助我(我的動畫應該是這樣的,在任何遊戲開始之前,我們都會看到倒數1,然後是2,然後3倒數)。如何解決動畫中的延遲問題?
- (ID)初始化 { 如果((個體= [超級INIT])) { [[CCDirector sharedDirector] setAnimationInterval:60.0/60]。 [[CCDirector sharedDirector] setDisplayFPS:NO];
CCAnimation* numberAnimation = [CCAnimation animationWithName:@"countDown" delay: 60.0/60];
for(int i=1;i<4;i++)
[numberAnimation addFrameWithFilename: [NSString stringWithFormat:@"number_%02d.png", i]];
id numberAction = [CCAnimate actionWithAnimation: numberAnimation restoreOriginalFrame:NO];
id action2 = [CCFadeOut actionWithDuration:0.5f];
CCSprite *number;
number = [CCSprite spriteWithFile:@"number.png"];
....
}}