Chapter 3: Things
3.26. Directions

"Direction" is a kind which is quite unlike most of those seen so far. While it has to do with the physical world, a direction does not exactly belong to it. One cannot find "southeast" sitting on a shelf, for instance. And while we could imagine a world with many or few containers (for instance), the idea of world with many or few directions is a little surreal. "Direction" is not a kind of thing, or a kind of room: it is a kind in its own right.

The chapter began with the twelve directions built into Inform:

north, northeast, east, southeast, south, southwest, west, northwest, up, down, inside, outside

While it is possible to create entirely new directions, this can be very tricky: if the effect we need is really just to give new names to directions (like "starboard" or "widdershins"), there are easier ways; if we wanted to write about a Flatland without up or down, we could use techniques from later chapters to prohibit going up or down. See the Recipe Book for examples.

Even though we do not need to create them, the kind "direction" is still useful to know about. For instance, we will later see ways of defining new commands, and we might want to allow "RUN EAST" - or in any other direction - so the kind "direction" is helpful to specify which ways the player can run. Another convenience is that a direction has an "opposite" property, which is always another direction. The opposite of north is south: the opposite of southeast is northwest: the opposite of inside is outside, and so on.


38
** Example  Prisoner's Dilemma
A button that causes a previously non-existent exit to come into being.

RB


PreviousContentsNext