Interactive fiction is a popular game style for computers, the game presents a situation and you, the player, must decide which path to take. Historically, games like ADVENT or Zork did this with text only. A modern implementation is the Bandersnatch episode of Netflix's Black Mirror series.
The basic idea is that at various points in the story, the reader is given a choice about how to proceed. Those choices take the reader down different paths, eventually leading to alternative endings.
This guide is an introduction to the PYOA application that lets you write and run your own adventures on the PyPortal complete with images, sounds, text, and choices.
The system described in this guide is strikingly similar in many ways to an Apple product from the late 80s: Hypercard.
The Adafruit blog as had posts about hypercard that are worth checking out: