Add objects to your barren Inform adventure rooms.
, we have
rooms, but they’re both empty.
Let’s create our first inhabitant: that fierce-eyed
access controller in the
Add this object to your source file. You can put it anywhere between
Include "VerbLib"; and
Include "Grammar"; lines, but it’s tidier to put
it right after the
Router object definition.
Object controller "access controller" Router, with name 'access' 'controller', article "an", description "The controller guards its network connection with fierce and watchful intent.", has scenery;
This is the
It’s similar to the
Scanner objects, but with a couple of differences.
The first line defines an
controller, printed in the game as
access controller, but there’s a fourth element,
Router, that indicates where the object is.
It’s not a free-floating thing, as the rooms are. It
begins the game inside the
Router (in fact, it
never moves from there).
has line, once again, introduces a list of
attributes. It’s down at the bottom this time.
(That’s a matter of taste; you can put the
has attributes before or after the
with property declarations.) The only attribute
scenery. This fixes the controller in
place; the player can’t pick it up or move it.
Scenery objects must also be mentioned in the
description property. The
standard library won’t mention it. The controller
does appear in the
Router’s description, so this ...