Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
icheered committed Mar 15, 2023
1 parent b49313d commit cd68b90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Text based adventure
One approach to a text based adventure. The story has been separated in a separate file as to not mix code and story.

Check out story.txt for an example of the syntax.
- +variablename[Text to print] - Ask for user input and store it in variablename
- {variablename} - Print the value of variablename
- [storyblock] - Start a storyblock
- @storyblock - Jump to a storyblock
- If there are multiple jumps, the user is shown a prompt where they can choose which storyblock to jump to. The syntax is @storyblock[Text to print](valid user options)

The first storyblock must be called 'start' and the final storyblock must be called 'end'.
1 change: 0 additions & 1 deletion story.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ What is your name?
Hello {username}!

Do you want to pick up the item?
;
@itempickup[Pick up](yes y)
@itemnotpickup[Don't pick up](no n)

Expand Down

0 comments on commit cd68b90

Please sign in to comment.