2014-01-15 4 views
0

누군가가 참/거짓 조건에 따라 두 세트의 이미지 애니메이션을 도울 수 있습니까? "CCAnimation"을 사용할 때 "인터페이스 유형을 정적으로 할당 할 수 없습니다"라는 오류 메시지가 나타납니다.CCAnimation 여러 이미지 집합

//---frameSetOne 

for (int i=1; i<=4; i++) { 
    [framesOne addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"bird%d.png",i]]]; 
} 

//---frameSetTwo 

for (int i=5; i<=8; i++) { 
    [framesTwo addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"bird%d.png",i]]]; 
} 

if (Answer == 1) { 

    CCAnimation _flyAnimation = [CCAnimation animationWithSpriteFrames:framesOne delay:0.07f]; 
} 

else 
{ 

    CCAnimation _flyAnimation = [CCAnimation animationWithSpriteFrames:framesTwo delay:0.07f]; 

} 

누군가가 문제를 해결하는 데 도움 또는 참 또는 거짓 조건을 사용하여 프레임/이미지의 여러 세트를 애니메이션의 다른 방법을 제안 할 수 없습니다 : 여기 내 코드는?

ThanksInAdvance!

+0

오류가 발생한 줄은 무엇입니까? – Voldemort

+1

시도 * _flyAnimation – YvesLeBorg

답변

0

시도 :

CCAnimation* _flyAnimation = [CCAnimation animationWithSpriteFrames:framesOne delay:0.07f]; 

클래스 메소드 animationWithSpriteFrames를 호출 : 방법은 CCAnimation의 *이 아닌 CCAnimation을 반환합니다.