screen 12 ' 80 characters wide
q
= chr$(34) ' *** Double quote
' ===== Flags =====
' ----- Standard flag values -----
const no_item
= 0 ' Most items will start in this state const used_item
= 2 ' Generally used when an item is no longer in the inventory, and can't be re-acquired
' ----- Inventory items -----
' Listed first as they will be listed in constant-numerical order when "inv" is typed
const i_sh_deadflashlight
= 1 ' No batteries const i_sh_flashlight
= 2 ' Has batteries
const i_sh_drawerkey
= 6 ' When used_item, the drawer has been opened const i_sh_keyring
= 7 ' Car keys const i_sh_papers
= 8 ' Papers containing addresses of three destinations
' ----- Non-inventory flags -----
' Things such as doors, lights, any state the game needs to keep track of
const f_sh_drawertop
= 12 ' Number of times drawer has been opened const f_sh_drawermiddle
= 13 ' Middle drawer state const f_sh_bonk
= 14 ' Whether the player has run into the bedroom door const f_sh_doorbedroom
= 15 ' Bedroom door state const f_sh_doorfront
= 16 ' Front door state const f_sh_clearingseen
= 17 ' Player has noticed the clearing in the grass
dim shared flag
(total_flags
) as byte
' All flag states stored here dim shared item_name$
(total_items
) ' Names of items, for inventory display
item_name$(i_sh_deadflashlight) = "Flashlight without power"
item_name$(i_sh_flashlight) = "Flashlight"
item_name$(i_sh_batteries) = "Pack of D batteries"
item_name$(i_sh_drawerkey) = "Small aluminum key"
item_name$(i_sh_keyring) = "Keyring with red bell fob"
item_name$(i_sh_papers) = "Assorted papers"
' ----- Location references -----
' On title screen, player can choose new or resume.
' If resume, loaded file will contain this location value, and the flag() array.
const loc_home_bedroom
= 1 const loc_home_machinery
= 4 const loc_home_clearing
= 7
' ----- Input handling -----
' *** Title menu here should allow loading a saved game
' *** Following branch is used when finished loading
case loc_home_bedroom:
goto home_bedroom
case loc_home_machinery:
goto home_machinery
case loc_home_clearing:
goto home_clearing
' --------------------------------------------------
' ===== THE SCENT OF ADVENTURE: The Safe House =====
' --------------------------------------------------
home_bedroom:
?"You wake up in bed. This is surprising to no one. It is also not surprising"
?"that this is the beginning of the game; it's almost like this was written with"
?"very little planning. You stand up slowly, it feels like forever since you"
?"were awake."
?
?"You feel like typing 'look' would give you more information about this room."
location = loc_home_bedroom
?"You are in a simple bedroom, with a small bed against the east wall."
?"Bright sunlight is visible through the south window, above a chest of drawers."
?"There is a door to the north."
?
?"You ponder the four compass directions. North, east, south, west. Each one"
?"has its own starting letter! This is convenient, since moving around won't"
?"require you to type the whole word. Just one letter will do."
?
?"Oh, also, you can type a word after 'look,' to examine something more closely."
if flag
(i_sh_drawerkey
) = no_item
then ?"A white-painted four poster bed with a blue coverlet. It's set about a foot"
?"above the floor-- oh! The sunlight is glinting off something on the floor"
?"next to the bed. It's a small aluminum key."
?"A white-painted four poster bed with a blue coverlet. It's set about a foot"
?"above the floor."
?"It's made of sturdy-looking wood, but isn't painted or varnished."
?"A single-shutter affair, unpainted, with no curtains."
?"The glass is glass-colored."
?"The chest is painted light blue and has three drawers."
?"The bottom one has a keyhole between the handles."
?"Seems to be made of aluminum."
if flag
(i_sh_batteries
) = no_item
and flag
(f_sh_drawermiddle
) = true
then ?"You've got the batteries. To see your items, type 'inv.' Why 'inv'?"
?"It's an abbreviation. It stands for 'investigate.' You use it to"
?"'investigate' your inventory."
flag(i_sh_batteries) = have_item
if flag
(i_sh_drawerkey
) = no_item
then ?"You've got the key. To see your items, type 'inv.' Why 'inv'?"
?"It's an abbreviation. It stands for 'inventive.' You've got to be 'inventive'"
?"when deciding how to use your inventory."
flag(i_sh_drawerkey) = have_item
?"There are so many drawers here! Top, middle, bottom."
?"Why, there is even one more than two drawers here!"
if flag
(f_sh_drawertop
) < 4 then ?"It slides open easily, but there's nothing inside, so you close it again."
flag(f_sh_drawertop) = flag(f_sh_drawertop) + 1
?"It slides open easily, but there's NOTHING INSIDE SO YOU CLOSE IT AGAIN. Gosh."
if flag
(f_sh_drawermiddle
) = false
then ?"It slides open easily. There is a pack of D batteries inside, enough to power"
?"a large flashlight. You can carry a lot of stuff, why not get these?"
?"'Get.' Hey, that's another thing you can type!"
flag(f_sh_drawermiddle) = true
?"That drawer is already open."
if flag
(i_sh_drawerkey
) = no_item
then ?"It won't open. If you do find the key, just try opening the drawer again,"
?"unlocking is part of opening a locked thing."
?"The key fits awkwardly into the chintzy lock, which takes some fiddling to pop"
?"open. The drawer slides open, but there's nothing inside. Is this the true"
?"meaning of 'tutorial'?"
?
?"You close the drawer with the key inside, then lock it again, just to screw"
?"with the next guy. Though I'm not sure how you even did that."
flag(i_sh_drawerkey) = used_item
?"You already locked the key inside, remember?"
if flag
(f_sh_doorbedroom
) = door_open
then ?"It's already open."
elseif flag
(f_sh_doorbedroom
) = door_closed
and flag
(f_sh_bonk
) = false
then ?"You turn the handle and pull the door open. It swings soundlessly."
?"The scent of adventure wafts into the room."
flag(f_sh_doorbedroom) = door_open
elseif flag
(f_sh_doorbedroom
) = door_closed
and flag
(f_sh_bonk
) = true
then ?"You turn the handle and pull the door open. It protests vehemently, hinges"
?"creaking loudly and several long splinters snapping off. But at least it's"
?"open. The scent of adventure wafts into the room."
flag(f_sh_doorbedroom) = door_open
if flag
(f_sh_doorbedroom
) = door_closed
then ?"I think the door felt that more than you did. Doors tend to turn into doorways"
?"when you do something to them... I think it starts with 'O'?"
?"(And you should be specific about what you want to 'open,' too.)"
flag(f_sh_bonk) = true
?"You step out into the hall. The morning sunlight shining through the east"
?"window reveals quite a bit of dust in the air. You continue to the west end"
?"of the hallway."
home_hall:
location = loc_home_hall
?"You're in a narrow east-west hallway. The sun is casting a shaft of blinding"
?"light through the east window, and the floor is coated in a thin layer of dust,"
?"which kicks up into the air as you move. Through the north door you can see"
?"a room with a large table; the south door reveals a dark room almost completely"
?"occupied with some intimidating machinery. East leads back to the bedroom."
?"The door at the west end, which is much older-looking than the others,"
if flag
(f_sh_doorfront
) = door_closed
then ?"is closed." if flag
(f_sh_doorfront
) = door_open
then ?"is open."
?"Like the bedroom, there is no carpet or other flooring here, just a rough"
?"wooden floor covered in dust. There were no footprints in the dust, you now"
?"realize."
?"It just seems to be ordinary dust that would accumulate anywhere."
?"There are many dials and buttons, but to get a closer look, you'll have to"
?"walk into the room."
if flag
(f_sh_doorfront
) = door_closed
then ?"The door opens on a small flight of three steps made of grey concrete, and a"
?"dirt path leads from the steps to a gate in a wooden post fence, along a small"
?"road. West across the road is a thick, colorful forest. The grass next to"
?"the path is almost knee-high, and has gone to seed."
?
?"A rotted chunk of the door's latch breaks off and falls into the weeds next to"
?"the steps. The door swings itself wide and rests against the side of the"
?"house."
flag(f_sh_doorfront) = door_open
?"You step into the north room."
?"You return to the bedroom."
?"You peer cautiously into the room filled with machines. You hadn't noticed it"
?"out in the hall, but there's a very faint humming sound."
if flag
(f_sh_doorfront
) = door_open
then ?"You step out into the glorious sun. It's a brisk fall day, but not cold."
home_table:
location = loc_home_table
?"This room has a large, rounded oak table against the north and west walls,"
?"it's a bit too big for this room, and there are no chairs. The north wall"
?"has another small window, which is blocked by tall grass, so the room isn't"
?"very brightly lit."
if flag
(i_sh_deadflashlight
) = no_item
and flag
(i_sh_papers
) = no_item
then ?"On the table, there are some scattered papers, as well as a large flashlight."
elseif flag
(i_sh_deadflashlight
) <> no_item
and flag
(i_sh_papers
) = no_item
then ?"On the table, there are some scattered papers."
elseif flag
(i_sh_deadflashlight
) = no_item
and flag
(i_sh_papers
) <> no_item
then ?"On the table, there is a large flashlight."
elseif flag
(i_sh_deadflashlight
) <> no_item
and flag
(i_sh_papers
) <> no_item
then ?"There's nothing on the table."
if flag
(i_sh_deadflashlight
) = no_item
then ?"It looks heavy, and is made of black-painted metal."
if flag
(i_sh_papers
) = no_item
then ?"There's a lot to take in here. There are pages with lists of numbers, pages"
?"with indecipherable handwriting, maps of various places, a few pamphlets to"
?"local attractions, some receipts for small purchases, and a thin, almost"
?"used-up pad of tear-off legal stationery."
if flag
(i_sh_deadflashlight
) = no_item
then ?"You've got the flashlight. It's lighter than you expected and doesn't work;"
?"checking the battery compartment, you find there are no batteries. If you find"
?"some, using the batteries is clear enough. Generally, if you 'use' something,"
?"you'll know how to use it and what to use it on."
flag(i_sh_deadflashlight) = have_item
if flag
(i_sh_papers
) = no_item
then ?"You pick up the mass of papers, hold them vertically, and shake them briskly"
?"against the table to form a neat stack. A lot of this information seems"
?"random and probably useless, but in your situation, anything can help."
?"Perhaps some of this will make more sense later."
flag(i_sh_papers) = have_item
?"You return to the hallway."
home_machinery:
location = loc_home_machinery
?"It's surprisingly dark in here, there are no windows. The only light is coming"
?"from the buttons and the hallway. There don't seem to be any lights to turn on"
?"here, either - all of the walls are bare."
?
?"Around the sides of the room are industrial-looking metal consoles. There are"
?"less buttons and such than you expected. In one corner of the floor, you can"
?"barely make out a thick metal disk, about two feet in diameter. There is a"
?"matching disk mounted to the ceiling above it. These are both connected to the"
?"main bulk of the technology by rubber-coated cables, as thick as your arm."
?"The light emanating from the buttons is dim, and all of the display screens"
?"are off."
if flag
(i_sh_flashlight
) = have_item
and flag
(i_sh_keyring
) = no_item
then ?
?"On top of one of the consoles is a small keyring, with two identical keys and"
?"a red bell fob."
?"It just looks like a slab of solid metal. Moving your hand close, you can"
?"sense a slight throbbing. Otherwise, it betrays no sign of its purpose."
?"The buttons are mostly about finger-sized, and various colors. Nothing"
?"resembles a keyboard. There are a few labels here and there, but mostly"
?"numbers and a few letters, nothing intelligible. Whatever these do, you"
?"haven't a ghost of a clue how to use them."
if flag
(i_sh_keyring
) = no_item
then ?"The keyring itself is about an inch wide, the keys are small and made of brass."
?"The red bell is about the same size as the keys.
end if
end select
select case object$
case "keyring"
if flag(i_sh_keyring) = no_item then
?"You've got the keyring. The keys being the same, it won't matter which one"
?"you use. The bell tinkles merrily."
flag(i_sh_keyring) = have_item
?"You return to the hallway."
home_path:
location = loc_home_path
?"There's a good breeze going, the trees are swaying a bit, but there are no"
?"other sounds. The grass gets even taller a few yards on either side of the"
?"path, obscuring your view of the countryside. The fence beside the road is"
?"a simple post fence made of narrow logs, with a gate leading to the road,"
?"which is paved with coarse gravel. Behind the small house is another forest."
?"The sky is a steely blue, with a few large clouds."
?"The house is raised off the ground, with a crawlspace underneath, choked with"
?"grass and weeds. It's a simple rectangular shape with a sloped roof,"
?"unpainted, the outer walls covered in smooth wood paneling. Despite the"
?"obvious age of the gate and front door, the rest of the house appears very new,"
?"showing no signs of wear."
?"It's too overgrown to explore. On the right side, you can see a stack of"
?"cinderblocks supporting the part of the floor under the room with the machines."
?"There are no signs of traffic, and no mailbox. You can't see much of the road"
?"from here, due to the tall grass."
?"The gate has no latch, only a rusty pair of hinges. Wedged into the hinges"
?"is a folded, weatherworn flyer with colorful printing."
?"You read, 'Old Uncle Tommy's BONA FIDE Robot Bounties! Redeem your old useless"
?"robots for cash in hand! Sentient toaster giving you lip? Show it what for,"
?"call Uncle Tommy today!"
?
?"You feel a twinge of sympathy for the poor robots."
?"Swinging the door shut, you can see the words 'SAFE HOUSE' painted in black"
?"on the side of the house where it was. At first it seems machine printed,"
?"as it's in a very neat typeface, but looking closer, you can see brush strokes."
?
?"With the latch broken, the door swings open again in the breeze, clattering"
?"loudly against the house. That was probably audible for a mile or so."
?"You go back inside the house."
?"You hop spryly over the gate, landing at the shoulder of the gravel road with"
?"a crunch. It winds north and south, disappearing before long around the trees."
?"A part of you wants to go exploring in the tall grass, but the cold, rational"
?"side of you realizes there are more likely ways to answer your pressing"
?"questions."
if flag
(f_sh_clearingseen
) = false
then ?"A part of you wants to go exploring in the tall grass, but the cold, rational"
?"side of you realizes there are more likely ways to answer your pressing"
?"questions."
?"Wading through the tall stalks of grass for a while, you eventually come across"
?"a small patch that has been leveled by the presence of a car! Only the part"
?"covered by the car is flattened, so the car is walled on all sides by grass."
home_road:
location = loc_home_road
?"The road is narrow, and could only accommodate one vehicle. The forest to"
?"the west is very thick and overgrown, the leaves an assortment of brilliant"
?"colors. Here and there, the first leaves are falling. To the east is the"
?"house you awoke in, with high grass to either side. On the north side of"
?"the house, the grass seems to thin out, as if there's a clearing just out"
?"of sight."
flag(f_sh_clearingseen) = true
?"You can't see anything interesting among the trees, it's far too crowded."
?"The road is old and narrow, and paved with dirt and gravel. Any vehicles"
?"using this road would cause a lot of noise and leave a cloud of dust."
?"The house looks especially out of place from here. All the surroundings are"
?"thickly grown and untended, but the house appears recently built."
?"Yes, there's definitely an open area among the grass to the north, some yards"
?"away from the house."
?"You venture north along the road for a few minutes, the perfect fall day putting"
?"a spring in your step, but all you find is more road and more forest. Perhaps"
?"it would be best to find a faster mode of travel. You return to the gate."
?"You venture south along the road for a few minutes, as it's excellent weather for"
?"a walk, but there isn't much to see, as the road seems to go on endlessly."
?"Perhaps it would be best to find a faster mode of travel. You return to the gate."
?"You vault back over the gate onto the path."
?"You see no reason to venture into the forest."
home_clearing:
location = loc_home_clearing
?"You are standing in tall grass, with a car in front of you. It's difficult"
?"to see much else."
?"It's an old brown coupe, it seems in decent working order from here, the paint"
?"is weatherbeaten but not peeing, and you can't see any rust. What you can see"
?"of the tires says they are probably fine. You're on the driver's side,"
?"the car is pointing toward where the road should be. The seats are a tacky"
?"yellow flannel, so on second thought, the car should probably be condemned."
if flag
(i_sh_keyring
) <> have_item
then ?"With some difficulty pushing the grass aside, you slowly work the driver's"
?"side soor open and climb inside. There are no keys in the ignition, neither"
?"in the glove box or anywhere else that you can see, so you climb back out."
?"With some difficulty pushing the grass aside, you slowly work the driver's"
?"side door open and climb inside, closing the door behind you. It closes on"
?"some of the grass, but there's not much point trying to get it completely"
?"clear. Taking out the keyring, you insert one of the keys and give it a turn."
?"The engine sputters a bit, but starts on the first try."
?
if flag
(i_sh_papers
) <> have_item
then ?"However, the road ahead is likely to be long and confusing, and you don't have"
?"a good idea of where to go from here. It would be a good idea to form a basic"
?"plan first. You kill the motor and get back out."
?"You should be able to get the car to move west from here onto the road."
?"You have a mind to check out some of the places described among the papers"
?"you found."
?"There's no reason to search past this point."
?"There's no reason to search past this point."
?"There's no reason to search past this point."
?"You navigate the tall grass again and make your way back to the house."
home_car:
location = loc_home_car
?"You're sitting in an old brown car facing roughly west, surrounded by tall"
?"grass. The car is running, and presumably the road is through the grass"
?"in front of you."
?"The grass is thick, and it would be awkward and pointless to try to move that way."
?"The grass is thick, and it would be awkward and pointless to try to move that way."
?"The grass is thick, and it would be awkward and pointless to try to move that way."
?"It takes some pumping the gas to get the car through the grass ahead, but after"
?"a minute or so of coaxing, you emerge, the front of the car pointed onto the"
?"road. Each of the pamphlets shows an interesting location and lists an address"
?"with a small map. There's a bigger travel map in the glovebox, so while"
?"navigating might be a bit touch and go at first, you're confident you can"
?"figure it out. Type one of the following to drive there:"
?
?"'drive 1' - Newport Theater, 544 Old Elanise Road"
?"'drive 2' - Kenworthy Historical Estate, 1202 *** Avenue"
?"'drive 3' - David H. Christopher Public Library, 4 Vicksburgh Circle"
?
?"Currently, none of these locations are implemented in the game."
?"You've completed the teaser!"
?
?"This is a side project to my main game development project, so I will be"
?"continuing it as I feel motivated to. Thanks for playing!"
?
?"Press enter to exit."
?
' --------------------
' ===== Routines =====
' --------------------
' This sub is never called, it contains templates.
' --- Text width ruler, at location select case indent ---
' ?" 1 2 3 4 5 6 7 8
' ?"12345678901234567890123456789012345678901234567890123456789012345678901234567890"
' --- Location template ---
'home_bedroom:
location = loc_home_bedroom
' Other verbs as needed
letter = false
?
' Process input into verb and object
' Remove all non-letter, non-space characters
' Remove leading spaces
' Extract first word to verb$
' Remove leading spaces
' Extract second word to object$, use empty string if none
object$
= left$(i$
, p
- 1)
' Verb shortcut replacement
case "n": verb$
= "north" case "s": verb$
= "south"
'? "["; verb$; "] ["; object$; "]"
?
' Global commands - can be used from anywhere
?"[h or help] - Show this information"
?"[l or look] - Look around, or at something specific"
?"[o or open] - Open something, keys will be used automatically"
?"[u or use] - Use something, can generally replace other verbs"
?"[g or get] - Pick up an item, type [inv] to see your items"
?"[n, e, s, w, or north, east, south, west] - Move around"
?"[nw, se, northwest, southeast, etc] - Move around some more"
?
?"These are only the most common commands. Some situations will"
?"require others. However, you will never need more than a verb"
?"followed by a thing."
?"--- INVENTORY ---"
if flag
(n
) = have_item
then ? item_name$
(n
)
if flag
(i_sh_batteries
) = have_item
and flag
(i_sh_deadflashlight
) = have_item
then ?"You open the package and pop the batteries into the handle of the flashlight."
?"Testing the switch, it's now powered and will last as long as you'll need."
flag(i_sh_batteries) = used_item
flag(i_sh_deadflashlight) = used_item
flag(i_sh_flashlight) = have_item
' Looking at items in inventory
' Only one key in this intro chapter, but multiple keys possible later
' These papers may reveal more later on, so the text will depend on progress