Asciidoc is just like any Asciidoc document.
Any chapters that do not have the [.gameplay] role are treated like normal chapters.
You can use this to introduce your game world, rules and mechanics.
If you mark a section with the [.gameplay] role you tell Asciihero that this is the core of your gamebook.
Within this section any child with the [.segment] style will be considered a segment.
A segment is a single numbered part of your gamebook.
In Asciihero segments of a gamebook are regular AsciiDoc section with the [.segment] style.
This tells Asciihero that this section should be treated as a section and should be processed.
Note how the section in the Asciidoc source is called entrance_hall, but the rendered document is shown as "1".
This is a bit of convenient magic that Asciihero applies.
This allows you to give your segments logical names that you can remember, and Asciihero will turn them into numbers for when it matters.
You can use these segment names with the turn:[] macro to automatically place a link with the correct number.
If you want to learn about choices, turn to turn:choices[].
If you want to learn about combat, turnto:combat[].
Or do you want to turnto:combat[fight a monster]?
The turn:[] macro is great if you want to embed the segment number into a sentence.
But sometimes you want to show multiple choices in a more consistent manner.
You can use an unordered list with the [choices] style for that.
-
choice:entrance_hall[North? And this one is so long that it actually wraps. How do we make this look good?]
-
choice:combat[South?]
So you want to fight some creatures do you?
In Asciidoc you can easily include a combat block using an unordered list with the [combat] style.
-
enemy:Goblin[strength=12, dexterity=10]
-
enemy:Goblin[name=Evil Goblin, strength=4, dexterity=3]
If you win, turn:game_over[].