Wohoo, the first proper authoring gamefic question!
In the master-tape code, I see the use of .session to store values. Is that a pattern you recommend?
For example - returning to that cracked mirror example - is this a good way of doing it?
mirror = make Item,
:name => 'mirror',
:parent => gallery,
:description => "A mirror"
mirror.session[:cracked]=false
respond :look, Query.new(:siblings, mirror) do |actor, mirror|
actor.tell "The mirror is #{mirror.session[:cracked] ? 'cracked' : 'intact'}."
unless mirror.session[:cracked] then
actor.tell "Uh oh. You dropped it."
mirror.session[:cracked] = true
end
end
Or is it better to create classes or mix-ins to store values in actual instance fields? Is there anything particular I should think of regarding this?