Writing a Simple Gamebook
From TheGamebookEngine
Prerequisites
- You must know how to start The Gamebook Engine program and load a gamebook.
Writing a Simple Gamebook
This is a simple gamebook, like the classic Choose Your Own Adventure stories:
"Simple gamebook" by Brandon Barnes #start You are in a dark room. You don't know how you got here, or who you are. There is a warm 5-pack of generic soda in the corner. To drink the soda, press #drink To stand up, press #stand To give up, press #giveup #drink Yuck. It's warm. To take another sip, press #drink To stand up, press #stand #stand You stand up, and feel woozy. You have been drugged. Press #continue to continue your adventure #giveup That was easy. You lose. #continue ...
The Code Explained
"#start", "#drink", and "#stand" are each page names. The page name is how you identify a page. Every page must start with a page name, which is always identified by starting the line with "#".
Each following line that does not include "#" is a text section. Text sections will be the bulk of your story, where you explain who the character is, what he is doing, what other characters are doing, his surroundings, etc. If a page has text sections, they must immediately follow the page name.
Each line that has "#" in the middle is a choice. In a gamebook, the reader expects multiple choices on most pages. Choices are how the reader continues to read from one page to the next. If a page doesn't have any choices, then the adventure is over, the player either won, lost, or something in between. Notice that what is between the "#" and the next whitespace or punctuation is the name of the page that the reader will jump to if they choose that choice. If a page has choices, then they must immediately follow the text sections if they exist, or the page name if the page has no text sections.
At the top of the page, I gave the gamebook a title, and credited myself. The Gamebook Engine does not interpret any text before the first page, so you can write anything you want in this space.
