1
! ------------------------------------------------------------------------------
2
! Inform for New Writers
4
! The House - Version 2
6
! Last Modified: David Cornelson - 04-Jan-1998
8
! ------------------------------------------------------------------------------
10
Constant Story "The House";
13
"^Inform for New Writers^
14
The House - Version 2^
15
By New Writer (1998) - Last Compiled: 04-Jan-1998^";
17
Constant MAX_SCORE 100;
25
!-------------------------------------------------------------------------------
28
!-------------------------------------------------------------------------------
37
print ", earning you the rank of ";
38
if (score >= 100) "the greatest.";
39
if (score >= 80) "above average.";
40
if (score >= 60) "average.";
41
if (score >= 40) "below average.";
42
if (score >= 20) "the barely living.";
46
! ----------------------------------------------------------------------------
49
! In this section we will define our locations. These are "Objects" to Inform
50
! and contain the following elements.
53
! The object name represents the variable or handle of the object.
55
! The short description is the description printed in bold before the
57
! - initial description
58
! The initial description is printed only once when the location is first
59
! entered by the player.
60
! - normal description
61
! The normal description is printed everytime the player enters the location.
62
! - directional properties (tells which direction player can move) (optional)
63
! These include n_to, ne_to, e_to, up_to, in_to, etc. and are followed by
64
! another location object name.
66
! Properties are functions that you can add to an object that help determine
69
! Attributes are True/False values that help you remember certain states of
70
! an object or event, such as whether the lights are on or not. The positive
71
! value is represented as "light" and the negative would be "~light". There
72
! are standard attributes used by Inform and you can add your own as well.
74
! Actually, there's more than this, but we'll add the complicated stuff later!
76
! ----------------------------------------------------------------------------
78
Object Sidewalk "Sidewalk"
80
"You are standing on the sidewalk in front of a house to the west.",
85
! VERSION 2 - Adding more locations to your Inform program
87
! We're going to take one small step in this version. Let's add a bunch of
88
! locations so that the player can move around a little bit.
90
! Notice that in the Sidewalk Object definition we added a direction in the
91
! description "to the west" and we added the directional property "w_to"
92
! that leads to the "Front_Porch" location that we defined below.
94
! If you follow these examples you will see how locations are "connected"
95
! or "mapped" together with the directional properties. Feel free to change
96
! then around so that they connect in different ways.
98
! Q: In the "Front_Porch" definition, the description continues over two
99
! lines. Is this okay?
101
! A: Inform allows you to extend statements over multiple lines as you
102
! need. You may need to write code that extends over multiple lines
103
! but mostly it will be descriptions as in "Front_Porch". You don't
104
! need to add any extra characters to tell Inform that you've jumped
105
! to the next line either...Inform will figure that out when it compiles.
108
Object Front_Porch "Front Porch"
110
"This is the front porch of the house. There is an open door
111
leading inside to the west.",
119
"You are standing in the foyer of the house. It seems as though
120
you can go up a staircase, northwest, or back out the front
128
Object Hallway "Hallway"
130
"You are in the hallway on the first floor of the house. The
131
foyer is southeast and the kitchen is west of here.",
136
Object Kitchen "Kitchen"
138
"This is the kitchen of the house. A hallway can be seen to the
143
Object Upper_Hallway "Upper Hallway"
145
"This is the second floor hallway. Rooms can be seen north and
146
south and a staircase leads down.",
152
Object North_Bedroom "North Bedroom"
154
"This is a bedroom on the north side of the house.",
158
Object South_Bedroom "South Bedroom"
160
"This is a bedroom on the south side of the house.",
164
! ----------------------------------------------------------------------------
167
! The grammar section includes the file "Grammar" and will later include
168
! extensions to the standard grammar library.
170
! ----------------------------------------------------------------------------
174
! ----------------------------------------------------------------------------
175
! Compilation Results
176
! ----------------------------------------------------------------------------
177
! Command: INFRMW32 -J HOUSE02.INF
179
! PC/Win32 Inform 6.14 (8th September 1997)
185
! 11 "northeast wall"
186
! 12 "northwest wall"
187
! 13 "southeast wall"
188
! 14 "southwest wall"
193
! 19 "(darkness object)"
195
! 21 "(Inform Parser)"
196
! 22 "(Inform Library)"
197
! 23 "(with no short name)"