1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-07 17:44:22 +03:00
inform7/resources/Documentation/Examples/NightAndDay.txt
2023-07-24 11:56:58 +01:00

51 lines
2.2 KiB
Plaintext

Example: * Night and Day
Location: Multiple beginnings and repeats
RecipeLocation: Passers-By, Weather and Astronomical Events
Index: Cycle of day and night scenes
Description: Cycling through a sequence of scenes to represent day and night following one another during a game.
For: Z-Machine
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.