2014-02-17 34 views
0

所以我需要知道如果我的角色(鳥)hitTestObject與管道他在動畫結束後播放死亡動畫,它需要在幀中進入遊戲主時間軸AS3如何在MainTimeline中當角色死亡動畫結束時進入下一幀

if (bird.hitTestObject(pipe1)) { 

bird.gotoAndStop(3); //frame 3 = where the die animation is 

} 

LINK 1(這裏看到不同的幀爲動畫幀3是模具動畫) http://gyazo.com/67381832827bfb8a4dac2452076a4217

LINK 2(模具動畫) http://gyazo.com/bf5153a9d00e1478471fff7b73d0c592

所以在這裏你可以看到在動畫的結尾動畫有需要的代碼去遊戲結束幀的主要時間框架3

BTW它不是一個。至於文件,但在時間線中

謝謝你,如果你能幫助我,如果我的英語也不好抱歉,即時通訊荷蘭

回答

0

嘗試使用一個輸入框事件,像這樣:

if (bird.hitTestObject(pipe1)) { 

    bird.gotoAndStop(3); //frame 3 = where the die animation is 
    addEventListener(Event.ENTER_FRAME, waitForDeathAnimationToEnd); 

} 

function waitForDeathAnimationToEnd(e:Event) 
{ 
    if(bird.currentFrame === bird.totalFrames) 
    { 
     removeEventListener(Event.ENTER_FRAME, waitForDeathAnimationToEnd); 
     bird.stop(); 
     gotoAndStop(frameOrFrameLabelWhereYourGameOverFrameIs); //Replace with Game Over frame label or number 
    } 
} 
+0

你有Skype的或東西,所以我可以給你的文件仍然存在問題 – OneshotFire

+0

@OneshotFire是的,發送到我的電子郵件...這是在我的個人資料說明 – Cilan

+0

我發送它到您的電子郵件 – OneshotFire

相關問題