1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 01:54:21 +03:00
inform7/resources/Documentation/Examples/RockGarden.txt
2019-03-16 13:12:11 +00:00

39 lines
2.1 KiB
Plaintext

** Deciding the scope of something
(Continuous space with distant objects visible; Rock Garden)
A simple open landscape where the player can see between rooms and will automatically move to touch things in distant rooms.
A map of linked rooms works well for modeling enclosed or indoor space, and somewhat less well for modeling large open spaces, where a person should reasonably be able to see things which are much too far away to touch. With some modifications to scoping, though, we can create an environment where objects in nearby rooms are described and viewable, and where the player will automatically move towards distant items before interacting with them physically.
{*}"Rock Garden"
Section 1 - General Rules
Intervisibility relates rooms to each other in groups. The verb to be connected with means the intervisibility relation.
Definition: a room is inter-visible if it is connected with more than one room.
After deciding the scope of the player when the location is an inter-visible room:
repeat with other place running through rooms which are connected with the location:
unless the other place is the location, place the other place in scope.
Rule for reaching inside a room (called target) which is connected with the location:
let way be the best route from the location to the target;
if the way is not a direction:
say "You can't get over to [the target] from here.";
deny access;
say "(first heading [way])[command clarification break]";
try going way;
if the player is in the target, allow access;
otherwise deny access.
After looking when the location is an inter-visible room:
repeat with other place running through rooms which are connected with the location:
if the other place is not the location, describe locale for other place.
Section 2 - The Scenario
Rock Garden West is west of Rock Garden East. Rock Garden East contains a rake. Rock Garden West contains a bench and a maple leaf. The bench is an enterable supporter.
Rock Garden West is connected with Rock Garden East.
Test me with "get rake / drop rake / sit on bench / get rake".