(My personal Cloak of Darkness, for "let's see how they do it" purposes in different CYOA languages, is A Story As You Like It -- but as you can see, despite dabbling with it in a few languages, the only version that's gone live yet is the one I launched right here.)
In any case, this demonstration will be of limited use, since Blogger will assuredly manhandle any HTML I feed into it -- but what results should still be adequately valid for its source code to be of use or interest to at least the most non-programmatic inquirer.
. . .
Cloak of Darkness - A basic IF demonstration.
Based on Cloak of Darkness by Roger Firth. (See >ABOUT for more information on the game spec.)
Hurrying through the rainswept November night, you're glad to see the bright lights of the Opera House. It's surprising that there aren't more people about but, hey, what do you expect in a cheap demo game...?
Foyer of the Opera House
You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west.
You are wearing a velvet cloak, and you are carrying nothing.
. . .
Entrance to the Opera House
You've only just arrived, and besides, the weather outside seems to be getting worse.
. . .
Examine Self
You're just an everyday opera-lover.
. . .
Examine cloak
A handsome cloak, of velvet trimmed with satin, and slightly spattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room.
. . .
You move south.
Foyer bar
It is pitch dark, and you can't see a thing in here! What's going on?
- Would you like to try to find a light switch, look for another exit, or would you prefer to return to the Foyer?
. . .
You move west.
Cloakroom
The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east.
. . .
Foyer bar
Blundering around in the dark isn't a good idea!
- Would you like to persevere in your efforts or would you prefer to return to the Foyer?
. . .
Foyer bar
In the dark? You could easily disturb something! Besides, you are likely to be eaten by a grue!
- (Return to the Foyer.)
. . .
Examine hook
It's just a small brass hook, screwed to the wall.
- Would you like to hang your cloak on the hook, or would you prefer to return to the Foyer?
. . .
(Your score has increased by 1)
You remove the velvet cloak and hang it on the hook.
- (Return to the Foyer.)
. . .
This isn't the best place to leave a smart cloak lying around. . . .
The various implementations have been made as similar as possible. That is, things like object names and room descriptions should be identical, and the general flow of the game should be pretty comparable. Having said that, the games are implemented using the native capabilities of the various systems, using features that a beginner might be expected to master; there shouldn't be any need to resort to assembler routines, library hacks, or other advanced techniques. The target is to write naturally and simply, while sticking as closely as possible to the goal of making the games directly equivalent.
"Cloak of Darkness" is not going to win prizes for its prose, imagination or subtlety. Or scope: it can be played to a successful conclusion in five or six moves, so it's not going to keep you guessing for long. (On the other hand, it may qualify as the most widely-available game in the history of the genre.) There are just three rooms and three objects.
The Foyer of the Opera House is where the game begins. This empty room has doors to the south and west, also an unusable exit to the north. There is nobody else around.
The Bar lies south of the Foyer, and is initially unlit. Trying to do anything other than return northwards results in a warning message about disturbing things in the dark.
On the wall of the Cloakroom, to the west of the Foyer, is fixed a small brass hook.
Taking an inventory of possessions reveals that the player is wearing a black velvet cloak which, upon examination, is found to be light-absorbent. The player can drop the cloak on the floor of the Cloakroom or, better, put it on the hook.
Returning to the Bar without the cloak reveals that the room is now lit. A message is scratched in the sawdust on the floor.
The message reads either "You have won" or "You have lost", depending on how much it was disturbed by the player while the room was dark.
The act of reading the message ends the game.
And that's all there is to it...
You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west.
. . .
Entrance to the Opera House
You've only just arrived, and besides, the weather outside seems to be getting worse.
. . .
Examine Self
You're just an everyday opera-lover.
. . .
You move south.
Foyer bar
The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of message scrawled in the sawdust on the floor.
. . .
This plush bar is stained from long years of gin slings, rum punches and other high-class drinks.
. . .
You move west.
Cloakroom
The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east.
. . .
Examine hook
It's just a small brass hook, with a cloak hanging on it.
. . .
(Your score has increased by 1)
The message, neatly marked in the sawdust, reads...
"*** You have won ***"
. . .
Foyer of the Opera House
You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west.
You are wearing a velvet cloak, and you are carrying nothing.
. . .
Entrance to the Opera House
You've only just arrived, and besides, the weather outside seems to be getting worse.
. . .
Examine Self
You're just an everyday opera-lover.
. . .
Examine cloak
A handsome cloak, of velvet trimmed with satin, and slightly spattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room.
. . .
You move south.
Foyer bar
It is pitch dark, and you can't see a thing in here! What's going on?
- Would you like to try to find a light switch, look for another exit, or would you prefer to return to the Foyer?
. . .
You move west.
Cloakroom
The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east.
. . .
Foyer bar
Blundering around in the dark isn't a good idea!
- Would you like to persevere in your efforts or would you prefer to return to the Foyer?
. . .
Foyer bar
In the dark? You could easily disturb something! Besides, you are likely to be eaten by a grue!
- (Return to the Foyer.)
. . .
Examine hook
It's just a small brass hook, screwed to the wall.
- Would you like to hang your cloak on the hook, or would you prefer to return to the Foyer?
. . .
(Your score has increased by 1)
You remove the velvet cloak and hang it on the hook.
- (Return to the Foyer.)
. . .
Foyer of the Opera House
You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west.
. . .
Entrance to the Opera House
You've only just arrived, and besides, the weather outside seems to be getting worse.
. . .
Examine Self
You're just an everyday opera-lover.
. . .
You move south.
Foyer bar
The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of message scrawled in the sawdust on the floor.
. . .
You move west.
Cloakroom
The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east.
. . .
The message has been carelessly trampled, making it difficult to read.
"You have lost."
. . .
Examine hook . . .
This plush bar is stained from long years of gin slings, rum punches and other high-class drinks. . . .
This isn't the best place to leave a smart cloak lying around.
. . .
This plush bar is stained from long years of gin slings, rum punches and other high-class drinks. . . .
You can just distinguish the words...
It's just a small brass hook, with a cloak hanging on it.
No comments:
Post a Comment