This is an old revision of the document!
This page is written by Leon Arnott and is separate from the Twine documentation.
To demonstrate a number of new features and coding techniques introduced in Twine 1.4, I've made a number of example .tws files.
http://l.j-factor.com/twine/examples/Visited.tws
This file demonstrates how, by using the visited() function inside the <<if>> macro, the player's state can be tracked without using any variables. A “no-variable” Twine game can, for simple games, be easier and more fluent to write, due to not requiring the use of <<set>>.
http://l.j-factor.com/twine/examples/PassageMacro.tws
This file shows how, by using the <<display>> macro's shorthand, the parameter() function, and, optionally, the nobr tag, you can write passages and invoke them as if they themselves were macros. The example code shows a basic use-case: creating a macro that varies the player's pronouns depending on their initial choice.
http://l.j-factor.com/twine/examples/Transitions.tws
This file simply serves as an example of imported images, and the way in which they can be used both in passages and in stylesheets.
http://l.j-factor.com/twine/examples/TagCSS.tws
This file contains a number of stylesheets that have tags. These tags cause the stylesheets to only apply their CSS to passages with the same tag. You can use this to give specific passages a unique style. This example also shows how multiple tags can be used to combine multiple styles in the same passage.
http://l.j-factor.com/twine/examples/Transitions.tws
This file demonstrates a number of CSS transitions that can be added to your Sugarcane story. These are stylesheets that use the "transition" tag to signify that they should override Twine's default fade-in transition. This example also uses tags to allow each stylesheet to be viewed individually by the player.
http://l.j-factor.com/twine/examples/Remember.tws
This file provides a basic example of the <<remember>> and «forget» macros in use.
http://l.j-factor.com/twine/examples/StoryMenu.tws
This file simply serves as an example of imported images, and the way in which they can be used both in passages and in stylesheets.