State example twee code

:: StoryTitle
state example


:: StoryData
{
  "ifid": "72CBB42F-5887-473F-8592-77CD03AF0426",
  "format": "Harlowe",
  "format-version": "3.3.9",
  "start": "initialize",
  "zoom": 1
}


:: initialize {"position":"500,200","size":"100,100"}
<!-- saving my state for if i know i'm a werewolf -->
<!-- variable names: start with $, no spaces or other special character, letters and numbers okay, or underscore _ -->
(set: $found_reflection to false)
(set: $howl_count to 0)

<!-- in macros, passage names go in "" quotation marks -->
(go-to: "start")


:: moon {"position":"600,400","size":"100,100"}
You walk toward the moon.

<!-- if macro displays content based on the variable state -->
(if: $found_reflection is true)[
You see the moon and howl.
(set: $howl_count to it + 1)
(if: $howl_count > 1) [
You howled $howl_count times.
] <!-- end of if howl count -->
[[Howl again->moon]]
]<!-- end of if found reflection -->
<!-- else happens when if is false -->
(else:)[
You see the moon. You don't notice anything special.
]

[[Return->start]]


:: puddle {"position":"800,400","size":"100,100"}
(set: $found_reflection to true)

You see a reflection of a werewolf in a puddle, and you realize it is you.
[[Return->start]]


:: start {"position":"700,200","size":"100,100"}

<img src="https://openlab.bmcc.cuny.edu/mmp-270-fall-2024/wp-content/uploads/sites/3896/2024/09/3800498100_3bf8d94992_c.jpg" alt="a photo of the moon">

You wake up in a dark forest. You see the moon.

[[Walk towards the moon->moon]]
[[Walk away from the moon->puddle]]

Leave a comment

Your email address will not be published. Required fields are marked *