2013-03-31 41 views
1

我試圖使用if語句去導演遊戲項目中的兩個不同的框架,但是儘管我已經去了第32幀的一組,並去了第31幀的另一個,他們都去到同一幀31.我做錯了什麼?我無法弄清楚。 (見這裏的代碼示例:)導演Lingo問題 - 請參閱代碼

-

on timeOut 


    if the timer >= 360 and sprite(16).visible = 1 then 
    member ("tellIt").text = "TIME UP" 
    _movie.go(32) 


    end if 

    if the timer >= 360 and sprite(15).visible = 1 then 
    member ("tellIt").text = "TIME UP" 
    _movie.go(32) 


    end if 

    if the timer >= 360 and sprite(14).visible = 1 then 
    member ("tellIt").text = "TIME UP" 
    _movie.go(32) 

    end if 

    if the timer >= 360 and sprite(13).visible = 1 then 
    member ("tellIt").text = "TIME UP" 
    _movie.go(32 
    end if 

if the timer > 350 and sprite(16).visible = 0 then 
    _movie.go(31) 
    member ("endIt").text = "LUNCH IS FOR THE BIRDS" 
    member ("tellIt").text = "TIME FLIES" 
    end if 

    if the timer > 350 and sprite(15).visible = 0 then 
    _movie.go(31) 
    member ("endIt").text = "LUNCH IS FOR THE BIRDS" 
    member ("tellIt").text = "TIME FLIES" 
    end if 

    if the timer > 350 and sprite(14).visible = 0 then 
    _movie.go(31) 
    member ("endIt").text = "LUNCH IS FOR THE BIRDS" 
    member ("tellIt").text = "TIME FLIES" 
    end if 

    if the timer > 350 and sprite(13).visible = 0 then 
    _movie.go(31) 
    member ("endIt").text = "LUNCH IS FOR THE BIRDS" 
    member ("tellIt").text = "TIME FLIES" 
    end if 

    if the timer > 350 and sprite(12).visible = 0 then 
    _movie.go(31) 
    member ("endIt").text = "LUNCH IS FOR THE BIRDS" 
    member ("tellIt").text = "TIME FLIES" 
    end if 
-- 

此代碼是在電影劇本寫的。

我真的希望你能引導我走向正確的方向,因爲我沒有線索爲什麼它不會去我要求的框架。遊戲中的其他一切看起來都很好。

+0

你不想使用一個else語句嗎? – Ohiovr

回答

1

你有它的方式,它並不重要多少首先檢查的是真實的,如果後來的檢查中的任何一個爲真,那麼你會在幀結束了31

如果你在每個if語句中放置一個'exit',這將確保稍後的檢查沒有完成。像:

if the timer >= 360 and sprite(16).visible = 1 then 
    member ("tellIt").text = "TIME UP" 
    _movie.go(32) 
    exit 
end if