Skip to content

A nice approach to a text based adventure where the story and code are separated

Notifications You must be signed in to change notification settings

icheered/TextBasedAdventure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'.

About

A nice approach to a text based adventure where the story and code are separated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages