1

ディレクター ゲーム プロジェクトで if ステートメントを使用して 2 つの異なるフレームに移動しようとしていますが、あるセットではフレーム 32 に移動し、別のセットではフレーム 31 に移動する必要がありますが、両方とも同じフレーム 31 に移動しています。間違っている?私はそれを理解することはできません。(こちらのコード例を参照してください:)

--

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
--

このコードは映画の台本に書かれています。

なぜ私が求めているフレームに行かないのか見当がつかないので、あなたが私を正しい方向に導いてくれることを本当に願っています. ゲーム内の他のすべては正常に機能しているようです。

4

1 に答える 1

1

この方法では、最初のチェックのどれだけが true であるかは関係ありません。後のチェックのいずれかが true の場合、フレーム 31 で終了します。

各 if ステートメントに「exit」を入れると、後のチェックが行われないことが保証されます。お気に入り:

if the timer >= 360 and sprite(16).visible = 1 then
   member ("tellIt").text = "TIME UP"
   _movie.go(32)
   exit
end if
于 2013-03-31T14:45:19.090 に答える