Skip to content

Instantly share code, notes, and snippets.

@alexwarren
alexwarren / The Mysterious Courtyard.aslx
Created July 6, 2014 10:43
CodePlex Issue #798 Plain Text Attachments
<!--Saved by Quest Editor v5.0-->
<asl version="500">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="The Mysterious Courtyard">
<author>xordevoreaux</author>
<version>1.0</version>
<enablehyperlinks />
<defaultfontsize type="int">10</defaultfontsize>
</game>
@alexwarren
alexwarren / The Mysterious Courtyard.aslx
Created July 6, 2014 11:18
CodePlex Issue #797 Plain Text Attachments
<!--Saved by Quest Editor v5.0-->
<asl version="500">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="The Mysterious Courtyard">
<author>xordevoreaux</author>
<version>1.0</version>
<enablehyperlinks />
<defaultfontsize type="int">10</defaultfontsize>
</game>
[[section1]]:
This is section 1. [[Next]](section2)
{some shared text}
[[section2]]:
This is section 2. [Some passage]
[Some passage]:
{some shared text}
@set score=0
Choose an answer:
[The right answer](right)
[The wrong anser](wrong)
[right]:
@inc score
squiffy.story.go ("next")
$(document).on("click", "#enter-name", function () {
alert('ok...');
});
<button id="enter-name">Enter name</button>
@set a=2
Try two variables the [same](next, b=2) or [different](next, b=3).
[next]:
set("same", get("a") == get("b"));
a = {a}, b = {b}, same = {same}.
Increase by [one], increase by [ten], see the [[result]].
[one]:
@inc value
Value is {value}.
[ten]:
set ("value", get("value") + 10);
var randomnumber = function rng(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
set ("mynumber", randomnumber(1,6));
Generated {mynumber}.
Squiffy is a tool for creating interactive stories. This is sample is stored in a GitHub Gist.
You write your story in a text file. Each choice is represented by a [[new section]]. You can create links to new sections by surrounding them in double square brackets.
[[new section]]:
In addition to sections, Squiffy has the concept of passages. These are sections of text that don't advance the story. For example, you can click this [passage link], and this [other passage link], but the story won't advance until you click this [[section link]].
[passage link]: