我正在尝试使用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
--这段代码是写在电影脚本上的。
我真的希望你能引导我在正确的方向,因为我不知道为什么它不会去我要求它的框架。游戏中的其他一切似乎都运行得很好。
发布于 2013-03-31 22:45:19
按照你的方式,第一次检查有多少是真的并不重要,如果后面的任何一次检查都是真的,那么你就会在第31帧结束。
如果您在每个If语句中都放入一个'exit‘,这将确保后面的检查不会完成。像这样:
if the timer >= 360 and sprite(16).visible = 1 then
member ("tellIt").text = "TIME UP"
_movie.go(32)
exit
end ifhttps://stackoverflow.com/questions/15730357
复制相似问题