为什么不让它改变对象属性的值?

时间:2013-10-09 03:36:12

标签: inform7

我有这段代码,注释行打破了它。这里做错了什么?我知道我可以说笔可以是红色,绿色或蓝色;但我想使用值颜色或类似的东西与其他对象共享属性。

NicePlace is a room. "Its a pretty nice place."

A color is a kind of value.
The colors are red, green, blue.

A pen is a kind of thing.
A pen has a color called pencolor.

A coolpen is a pen.
The pencolor of coolpen is red.
[Now the pencolor of coolpen is blue.]

There is a coolpen in NicePlace.

1 个答案:

答案 0 :(得分:2)

像“现在......”这样的短语必须放在规则中,否则Inform不知道何时运行它们。所以试试这个:

When play begins:
    Now the pencolor of coolpen is blue.