"The Legend of Grammy's Apple" by Steve Ersinghaus & John Timmons
[Bibliographic data]
The release number is 1. The story creation year is 2007. The story headline is "Creating an Interactive Virtual Environment". The story genre is "Other". The story description is "An introductory example of how space is created, connected, and described, making and describing objects, as well as declaring rules so that clues matter and relationships make sense."
Release along with the source text, a website and an interpreter.
[This line simply tells Inform that we will be using American dialect and we will not be using scoring.]
Use American dialect and no scoring.
[This creates the first room (where the player will start) called the Foyer ending in a period. The text following is the description of this space enclosed in double quotations.]
The Foyer is a room. "The Foyer is a small space dominated by an oil portrait of your grandfather wearing a fez and a stocky statue of Elvis that holds candy. The Kitchen is north of here."
[This creates an object called the "handwritten note" and will be initially located in the Foyer. When it is examined, the game will display the text enclosed in double quotations immediately following "The description is "]
A handwritten note is in the Foyer. The description is "It is a note from your Grammy. It reads 'Please do me a favor and clean up the kitchen for me. Those apples keep falling out of the bowl. Love grammy'."
[This creates a new room called the Kitchen and tells Inform its relationship/connection to the Foyer.]
The Kitchen is north of the Foyer. "The Kitchen is accented in avocado and mustard-tinged paisley wallpaper. The Foyer is to the south."
[This creates a new object, initially located in the kitchen, called the fruit bowl. It is a container because we want to be able to put other objects into it.]
A fruit bowl is a container in the Kitchen. The description is "This is an antique dish that Grammy usually has filled with fresh fruit."
[This creates an object called an apple. An additional sentence tells us that the player can eat the apple.]
A apple is in the Kitchen. It is edible. The description is "This is a delicious-looking fresh apple. Your mouth waters at the sight of it."
[The following creates what Inform calls a "rule." We want to completely override the action of "eating the apple" and replace it with something else: when the player tries to eat the apple the game will end and print out the text in double quotations. Not the wording, the punctuation, and formatting.]
Instead of eating the apple:
end the game saying "You are suddenly aware of your age and your joints began to ache.[paragraph break]You have failed your grammy."
[Another "rule" to override when the player tries to put the apple into the fruit bowl.]
Instead of inserting the apple into fruit bowl:
end the game saying "The image of your Grammy appears before you carrying a sword that shines like that of Excalibur. She ceremoniously lays it upon your shoulder and knights you.[paragraph break]You are unaware of your age and feel that you could leap tall buildings in a single bound."