This lesson is called Branching Narratives - The Choose Your Own Adventure. It is designed to teach students about interactive storytelling and branching logic.
Prepare by familiarising yourself with branching logic and interactive storytelling concepts. Start with a discussion on choices in video games, using a tree diagram to visualise branching paths. Guide students through a class story using index cards, then support group work on creating their own narratives, ensuring clear instructions and debugging opportunities.
Ask students to think about their favourite video game.
Ask them how does it change when they make different decisions? What if they choose to go left instead of right? Do they always have to fight the bad guys or can they hide from them?
Explain that video games, and even movies and books, are built on a system of choices. Each time a player makes a choice, the program has to decide what happens next. This is called branching logic.
Draw a simple tree on the board.
Draw the trunk and label it "START".
Draw two branches coming off the trunk and label them "Choice A" and "Choice B".
Explain that a branch is a separate path the story can take. A program, just like a person, has to follow one path at a time.
This is where our if... then... else... logic comes in! The program essentially says: If
the player chooses A, then go down this path. Else (if they choose B), go down the other path.
Now you are going to write a very short adventure together. The teacher will be the narrator, and students will be the programmers.
Write the opening on the board.
"You are standing in front of two doors. One is made of solid oak and has a dragon carved into it. The other is a rickety wooden door with a rusty lock. Which door do you open?"
Introduce the Card System: We are going to use index cards to keep our story organised. Each card is a new 'scene' or 'page' in our program. As the students make their choice, draw a simple flowchart on the board that shows the path the story takes:
Card #1: (Opening text)
Choice: A (Oak Door) or B (Rusty Door)?
If A, go to Card #2.
If B, go to Card #3.
Work with the class to write the text for Card #2 and Card #3.
As students will see, the story has two very different endings, all because of one small choice. The computer had to follow a specific set of instructions to get to the correct ending.
It helps to have a happy ending and a sad ending in your example. Something like:
Card #2 (The Oak Door): The door creaks open to reveal a treasure chest full of gold. You are rich!
Card #3 (The Rusty Door): The door falls off its hinges and you land in a pit of angry squirrels.
Now it's their turn! Split the class into groups. Each group will be a team of story programmers. Their job is to create a branching narrative using index cards.
Give each group a stack of index cards and explain the instructions for writing them.
The Task: The groups must create a complete, branching narrative with a clear beginning, at least one major decision point, and at least two different possible endings.
Encourage them to draw a simple flowchart on a scrap piece of paper first to map out their story's branches.