mirror of
https://github.com/ganelson/inform.git
synced 2024-07-18 06:54:26 +03:00
47 lines
2.1 KiB
Plaintext
47 lines
2.1 KiB
Plaintext
* Multiple beginnings and repeats
|
|
(Cycle of day and night scenes; Night and Day)
|
|
Cycling through a sequence of scenes to represent day and night following one another during a game.
|
|
|
|
Suppose we want to have a sequence of nights and days in our game, with one scene to govern each daylight condition.
|
|
|
|
{*}"Night and Day"
|
|
|
|
The sun is a backdrop. It is everywhere. The description is "Currently out of sight."
|
|
|
|
Night is a recurring scene. Night begins when play begins. Night begins when Dusk ends. Night ends when the time since Night began is 3 minutes.
|
|
|
|
Notice that our two conditions for the beginning of Night are not in conflict: it will be night-time when the game begins, and then night will also recur every time the Dusk scene ends.
|
|
|
|
{**}When Night begins:
|
|
say "The sun falls below the horizon and the temperature drops abruptly to well below zero.";
|
|
now the description of the sun is "Currently out of sight."
|
|
|
|
Dawn is a recurring scene. Dawn begins when Night ends. Dawn ends when the time since Dawn began is 1 minute.
|
|
|
|
When Dawn begins:
|
|
say "The sun appears on the horizon.";
|
|
now the description of the sun is "It is tiny and weak.".
|
|
|
|
Day is a recurring scene. Day begins when Dawn ends. Day ends when the time since Day began is 3 minutes.
|
|
|
|
When Day begins:
|
|
say "The sun is now properly up."
|
|
|
|
Dusk is a recurring scene. Dusk begins when Day ends. Dusk ends when the time since Dusk began is 1 minute.
|
|
|
|
When Dusk begins:
|
|
say "The sun has passed across the sky and is on the verge of setting."
|
|
|
|
Cratered Landscape is a room. "The ground here is [if Night is happening]dim silver, with the craters visible as darker splotches[otherwise]the color of dried blood; here and there it is also rippled by impact craters[end if]. The horizon curves visibly."
|
|
|
|
Test me with "z / z / z / look / x sun / z / z / z / z / z / z / z".
|
|
|
|
If we run this example and then have a look at the scenes index, we'll see that the cycle is listed through thus:
|
|
|
|
Night (recurring)
|
|
Dawn (recurring)
|
|
Day (recurring)
|
|
Dusk (recurring)
|
|
Night
|
|
|
|
with the second "Night" in italics, to indicate that it is a repetition of the same scene that has already been listed above. |