"Timed Passages": Chapbook (v1.0.0)#
Summary#
Made famous in Queers in Love at the End of the World (2013), "Timed Passages" uses the JavaScript function setTimeout() and Chapbook's internal go() function to reload a passage every second. It combines the use of the Vars Section with multiple modifiers.
Example#
Twee Code#
:: StoryTitle
Chapbook: Timed Passages
:: Start
timeLeft: 11
--
[[Start->Timer]]
:: World End
The world ended.
:: Timer
timeLeft: timeLeft - 1
--
[if timeLeft > 0]
There are {timeLeft} seconds left.
[else]
{embed passage: 'World End'}
[JavaScript]
window.setTimeout(() => go('Timer'), 1000);