A Fuller Example

Here's a richer example: a cave exploration.  Note that you'll need to load "/cave" instead of "/cyoa".

The Flow

The JSON

Clicking on download Project zip below will give you a zip file that you will need to dig into to get the cave directory. Copy that to your CIRCUITPY drive.

[
    {
        "card_id": "start",
        "background_image": "page01.bmp",
        "text": "Welcome adventurer. Your adventure begins, as many do, in Ye Olde Inn.",
        "text_color": "0x000001",
        "button01_text": "Continue",
        "button01_goto_card_id": "inn"
    },
    {
        "card_id": "inn",
        "background_image": "page01.bmp",
        "sound": "pub.wav",
        "sound_repeat": "True",
        "text": "This is a peaceful, happy inn with plentiful drink, tasty food, and friendly staff.",
        "text_color": "0x000001",
        "button01_text": "Stay",
        "button01_goto_card_id": "inn",
        "button02_text": "Go!",
        "button02_goto_card_id": "cave entrance"
    },
    {
        "card_id": "cave entrance",
        "background_image": "page01.bmp",
        "text": "There is a dark cave in the hillside before you.",
        "text_color": "0x000001",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "button01_text": "Enter",
        "button01_goto_card_id": "entry",
        "button02_text": "Run",
        "button02_goto_card_id": "inn"
    },
    {
        "card_id": "entry",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "You are in a dark, narrow tunnel.",
        "text_color": "0x000001",
        "button01_text": "Next",
        "button01_goto_card_id": "side opening"
    },
    {
        "card_id": "side opening",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "You are in a small room, one tunnel leads ahead and another to the side. Do you continue on or explore the side tunnel?",
        "text_color": "0x000001",
        "button01_text": "Continue",
        "button01_goto_card_id": "skeleton room",
        "button02_text": "Side T.",
        "button02_goto_card_id": "treasure room"
    },
    {
        "card_id": "treasure room",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There is a pile of treasure here. Congratulations!",
        "text_color": "0x000001",
        "button01_text": "Next",
        "button01_goto_card_id": "maze 1"
    },
    {
        "card_id": "skeleton room",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There is a skeleton on the floor. From the items around it, it seems to be that of an unfortunate adventurer.",
        "text_color": "0x000001",
        "button01_text": "Next",
        "button01_goto_card_id": "maze 2"
    },
    {
        "card_id": "maze 1",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There are passages to the left and right.",
        "text_color": "0x000001",
        "button01_text": "Left",
        "button01_goto_card_id": "maze 3",
        "button02_text": "Right",
        "button02_goto_card_id": "maze 2",
    },
    {
        "card_id": "maze 2",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There are passages to the left and right.",
        "text_color": "0x000001",
        "button01_text": "Left",
        "button01_goto_card_id": "maze 1",
        "button02_text": "Right",
        "button02_goto_card_id": "maze 4"
    },
    {
        "card_id": "maze 3",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There are passages to the left and right.",
        "text_color": "0x000001",
        "button01_text": "Left",
        "button01_goto_card_id": "maze 5",
        "button02_text": "Right",
        "button02_goto_card_id": "maze 2"
    },
    {
        "card_id": "maze 4",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There are passages to the left and right.",
        "text_color": "0x000001",
        "button01_text": "Left",
        "button01_goto_card_id": "maze 1",
        "button02_text": "Right",
        "button02_goto_card_id": "maze 6"
    },
    {
        "card_id": "maze 5",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There are passages to the left and right.",
        "text_color": "0x000001",
        "button01_text": "Left",
        "button01_goto_card_id": "maze 4",
        "button02_text": "Right",
        "button02_goto_card_id": "creaking"
    },
    {
        "card_id": "maze 6",
        "background_image": "page01.bmp",
        "sound": "cave.wav",
        "sound_repeat": "True",
        "text": "There are passages to the left and right.",
        "text_color": "0x000001",
        "button01_text": "Left",
        "button01_goto_card_id": "creaking",
        "button02_text": "Right",
        "button02_goto_card_id": "maze 3"
    },
    {
        "card_id": "creaking",
        "background_image": "page01.bmp",
        "sound": "creak.wav",
        "sound_repeat": "True",
        "text": "You hear an ominuous creaking from around the corner",
        "text_color": "0x000001",
        "button01_text": "Cont.",
        "button01_goto_card_id": "bridge room 1",
        "button02_text": "Go back",
        "button02_goto_card_id": "inn"
    },
    {
        "card_id": "bridge room 1",
        "background_image": "page01.bmp",
        "sound": "creak.wav",
        "sound_repeat": "True",
        "text": "There is a creaking, rickity wooded bridge leading across a gaping chasm.",
        "text_color": "0x000001",
        "button01_text": "Cont.",
        "button01_goto_card_id": "bridge room 2"
    },

    {
      "card_id": "bridge room 2",
      "background_image": "page01.bmp",
      "sound": "creak.wav",
      "sound_repeat": "True",
      "text": "At the other end is a large treasure chest. There is also a short tunnel with daylight at the end.",
      "text_color": "0x000001",
      "button01_text": "Treasure!",
      "button01_goto_card_id": "die",
      "button02_text": "Leave",
      "button02_goto_card_id": "inn"
    },

    {
        "card_id": "die",
        "background_image": "page01.bmp",
        "sound": "scream.wav",
        "text": "The bridge gives way and you fall to a painful death.",
        "text_color": "0x000001",
        "button01_text": "Next",
        "button01_goto_card_id": "inn"
    }
]
This guide was first published on Jun 22, 2019. It was last updated on Jun 22, 2019. This page (A Fuller Example) was last updated on Sep 16, 2019.