| Chapter 9: Time |

| 9.5. Every turn

The passage of time in interactive fiction is broken up into a succession of turns, in each of which the player types a request and is given a response. Usually each such request triggers one action, but sometimes a whole sequence are fired off, as when the player types "get all" in a cluttered room.

One of the last things to happen in each turn is that Inform will apply any rules which have been set to occur "every turn", like so:

> Every turn, say "The summer breeze shakes the apple-blossom."

This is equivalent to writing:

> An every turn rule: say "The summer breeze shakes the apple-blossom."

Note that the text about blossom, which will quickly become tiresome, is said at the end of every turn, not at the beginning, and in particular not before the player's first opportunity to type a command.

As usual when defining rules, we can add stipulations: any condition can be attached using "when".

> Every turn when in the Orchard, say "The summer breeze shakes the apple-blossom."

> Every turn when the player can see the rotting fish, say "Your nose twitches involuntarily."

111
| Example Witnessed 1 A kind of battery which can be put into different devices, and which will lose power after extended use.

112
| Example Text Foosball A game of foosball which relies heavily on every-turn rules.

Previous | Contents | Next