如果玩家进入一个带有“充电”物体(他们的手机)的房间,我试图触发游戏结束。
我一定是不明白在输入位置时触发规则的语法,因为我意识到我的其他类似规则也没有发生。
我有:
Instead of entering Great Hall:
if phone is charged:
say "Hooray you win.";
Run Code Online (Sandbox Code Playgroud)
但规则如下:
Instead of entering Big house:
If butler is in big house:
say "'blah blah blah";
now player is in big house;
otherwise:
say "Oh no, can't get into the house.";
Run Code Online (Sandbox Code Playgroud)
也不工作。我阅读了关于结束游戏的第 9.4 节,也用之后和之前代替了我,但没有运气。有条件的玩家进入房间后怎么办?
谢谢!
当进入容器、支撑物和门等物体时会触发进入动作。对于您想要“去”的房间。
After going to the Great Hall when the phone is charged:
end the story saying "Hooray you win."
Run Code Online (Sandbox Code Playgroud)
最好让库尽可能处理房间之间的转换,而不是手动移动播放器,这就是continue the action这里的做法:
Instead of going to the Big House:
If the butler is in the Big House:
say "'blah blah blah'";
continue the action;
otherwise:
say "Oh no, can't get into the house."
Run Code Online (Sandbox Code Playgroud)