【问题标题】:Director Lingo Problems - See Code导演 Lingo 问题 - 见代码
【发布时间】:2013-03-31 14:20:24
【问题描述】:

我正在尝试使用 if 语句转到 Director 游戏项目中的两个不同帧,但即使我已经为一组转到第 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
--

这段代码写在电影剧本上。

我真的希望你能引导我朝着正确的方向前进,因为我不知道为什么它没有进入我要求的框架。游戏中的其他一切似乎都运行良好。

【问题讨论】:

  • 您不想使用 else 语句吗?

标签: if-statement statements lingo adobe-director


【解决方案1】:

按照你的方式,第一次检查中有多少是真的并不重要,如果后面的任何一个检查是真的,那么你将在第 31 帧结束。

如果您在每个 if 语句中都放置一个“退出”,这将确保以后的检查不会完成。喜欢:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多