首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Director Lingo问题-请参阅代码

Director Lingo问题-请参阅代码
EN

Stack Overflow用户
提问于 2013-03-31 22:20:24
回答 1查看 995关注 0票数 1

我正在尝试使用if语句在Director游戏项目中转到两个不同的帧,但即使我已经转到一组的第32帧和另一组的第31帧,它们都转到了同一帧31。我做错了什么?我想不出来。(请参阅此处的代码示例:)

--

代码语言:javascript
复制
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
--

这段代码是写在电影脚本上的。

我真的希望你能引导我在正确的方向,因为我不知道为什么它不会去我要求它的框架。游戏中的其他一切似乎都运行得很好。

EN

回答 1

Stack Overflow用户

发布于 2013-03-31 22:45:19

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

如果您在每个If语句中都放入一个'exit‘,这将确保后面的检查不会完成。像这样:

代码语言:javascript
复制
if the timer >= 360 and sprite(16).visible = 1 then
   member ("tellIt").text = "TIME UP"
   _movie.go(32)
   exit
end if
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15730357

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档