Chapter 9: Time
9.1. When play begins

With the material from previous chapters, we are now able to set up a simulated world, to respond to the player's actions within it, and to make it change in perhaps unexpected ways.

The resulting experience can be as lively as we want to make it, but so far we have no very good ways to give it any structure: a beginning and an end, for instance, or a sense of plot. This next chapter is all about the passage of time, and it begins at the beginning.

We have already seen an example of how to write a rule which applies just once, at the start of the game:

When play begins: say "Welcome to Old Marston Grange, a country house cut off by fog."

The "when play begins" rules are checked only at the start of a game, not when a saved session is restored from disc. What happens is that these rules are followed, then the game's banner is printed, then the initial room description is printed up, and then the player is asked for a first command.


135
* Example  Clueless
A murderer for the mystery is selected randomly at the beginning of the game.

RB

"When play begins" is the best point to initialize any aspects of the game that are meant to change between playings. For instance, in this scenario, we would randomly select one of the other characters to be guilty of murder:

"Clueless"

The murderer is a person that varies.

When play begins:
    now the murderer is a random person who is not the player.

The Billiards Room is a room. Colonel Mustard and Professor Plum are men in the Billiards Room. Miss Scarlet and Mrs White are women in the Billiards Room.

Instead of examining the murderer:
    say "[The noun] certainly looks fiendish!"

Test me with "x mustard / x plum / x scarlet / x white".


PreviousContentsNext