Twine is an open-source tool for telling interactive, nonlinear stories. 
Download and unzip the archive file for your OS.
/home/user/twine/twine_2.2.1 (where user is your username)
Files can be stored in
Twine can be loaded up from the cli terminal window with ./Twine (This IS case sensitive)
The boxes above represent different rooms of the game. You can create links between the rooms. For example.
So clicking entry way, causes the game to jump to that location. The two way arrow means you can move back and forth between rooms.
The code for this is fairly simple.
You stand in front of a small cave opening. [[Entry Way]]
The game has some advanced features, and 3 levels of creation ( Harlowe, SugarCube, and Snowma ). Each gives you different levels of sophistication, more complex but you can create more complicated elements. With some scripting and hacking you can add inventories for example.
Twine cookbook (Examples) can be found here https://twinery.org/cookbook/
Other info (docs, and tutorials etc ) can be found at :- https://twinery.org/wiki/
This could be great for schools, Code Club or CoderDojos.
Worth looking at.