Skip to content

Instantly share code, notes, and snippets.

@psenger
Created January 15, 2026 11:19
Show Gist options
  • Select an option

  • Save psenger/fe6a6d88dda943fb3fcb488280c4dc4c to your computer and use it in GitHub Desktop.

Select an option

Save psenger/fe6a6d88dda943fb3fcb488280c4dc4c to your computer and use it in GitHub Desktop.
[AI Powered Adventure] #code-warriors-code-camp

AI-Powered Adventure Game - Starter Files

These files are for the Code Warriors AI-Powered Adventure course.

Files Included

  • data.json - Story graph with 19 interconnected locations
  • config.example.py - Configuration template

How to Use

  1. Create a folder called AdventureGame
  2. Download both files into that folder
  3. Copy config.example.py to config.py
  4. Your instructor will provide the API key to add to config.py
  5. Follow Module 01 instructions to create the remaining Python files

What You'll Build

During the course, you'll create these additional files:

  • constants.py
  • utils.py
  • story_node.py
  • story_graph.py
  • inventory.py
  • ai_client.py
  • game_state.py
  • game_engine.py
  • main.py
  • And more!

Course: AI-Powered Choose Your Own Adventure Duration: 2 days Level: Year 9-12 (Intermediate Python)

"""
Configuration Template
Copy this file to config.py and add your API key
"""
# Claude API Configuration
CLAUDE_API_KEY = "your-api-key-here"
CLAUDE_MODEL = "claude-3-5-haiku-20241022"
# Feature flags
ENABLE_AI = True # Set to False to use fallback stories only
ENABLE_CACHING = False # Will be enabled in Module 08
{
"start": {
"story_key": "start",
"title": "🌲 The Enchanted Forest Gate",
"requires_items": [],
"connections": [
"forest_path",
"village_square"
],
"item_reward": null,
"story": "You step through the ancient Enchanted Forest Gate and feel a thrill of excitement as the trees whisper secrets in your ear. The air is filled with the sweet scent of blossoming wildflowers, and the soft chirping of forest creatures echoes through the air. As you look around, two paths stretch out before you, promising adventure and wonder.\nPlease choose to either walk along 🌿 The Mysterious Forest Path, where rumors whisper of hidden treasures and ancient magic, or head towards 🏘️ The Friendly Village Square, where warm smiles and bustling activity beckon you."
},
"forest_path": {
"story_key": "forest_path",
"title": "🌿 The Mysterious Forest Path",
"requires_items": [],
"connections": [
"old_tree",
"stream_crossing",
"village_square"
],
"item_reward": "magic_rope",
"story": "You step into the mysterious forest path, surrounded by towering trees that whisper secrets in the wind. As you walk, the leaves beneath your feet rustle with a soft humming noise, guiding you deeper into the woods. Suddenly, the path splits into three different directions - which one will you choose to follow?\nPlease choose to either visit 🌳 The Ancient Talking Tree, where its wise branches are said to share tales of the forest's ancient history, or head towards 🏘️ The Friendly Village Square, where villagers might be celebrating a magical harvest festival, or cross over 🌊 The Babbling Brook Crossing, where fish with shimmering scales are known to swim alongside travelers."
},
"village_square": {
"story_key": "village_square",
"title": "🏘️ The Friendly Village Square",
"requires_items": [],
"connections": [
"bakery",
"wizard_tower",
"forest_path"
],
"item_reward": "silver_key",
"story": "You step into the Friendly Village Square, surrounded by colorful stalls and smiling villagers. As you wander through the square, you notice a delicious aroma wafting from the nearby stalls, making your tummy growl with hunger! Suddenly, a friendly baker beckons you to come closer, saying \"Welcome, young adventurer!\" Please choose to either visit The Magic Bakery, where you can taste the most scrumptious treats in all the land, or head towards The Wise Wizard's Tower, where ancient secrets and mysterious artifacts await discovery."
},
"old_tree": {
"story_key": "old_tree",
"title": "🌳 The Ancient Talking Tree",
"requires_items": [
"magic_rope"
],
"connections": [
"tree_house",
"underground_cave"
],
"item_reward": null,
"story": "You step into the heart of the enchanted forest and find yourself standing before the magnificent 🌳 Ancient Talking Tree. Its gnarled branches stretch towards the sky, whispering ancient secrets to the wind. As you reach out to touch its trunk, the tree begins to speak in a low, rumbling voice, \"Come closer, young adventurer, I have tales of magic and wonder waiting for you!\"\nPlease choose to either visit 🏠 The Cozy Tree House, where the tree's whispers have mentioned a warm and inviting home filled with books and cozy nooks, or head into πŸ•³οΈ The Glowing Underground Cave, where strange bioluminescent creatures are said to light up the darkness."
},
"stream_crossing": {
"story_key": "stream_crossing",
"title": "🌊 The Babbling Brook Crossing",
"requires_items": [],
"connections": [
"fairy_glade",
"stone_bridge",
"wizard_tower"
],
"item_reward": "golden_coin",
"story": "You step into the magical forest and feel the soft mist of the Babbling Brook Crossing on your skin. As you follow the winding path beside the brook, you notice that the water is filled with tiny fish wearing shimmering crowns, swimming in perfect harmony with the playful sound of the brooksongsters singing in unison.\nPlease choose to either visit 🧚 The Sparkling Fairy Glade, where a fairy named Flicker is said to be waiting for new friends, or head across the water's edge towards πŸŒ‰ The Ancient Stone Bridge, which is rumored to have hidden runes that only appear under moonlight."
},
"bakery": {
"story_key": "bakery",
"title": "πŸ₯– The Magic Bakery",
"requires_items": [
"silver_key"
],
"connections": [
"secret_cellar",
"garden_maze"
],
"item_reward": "magic_flour",
"story": "You step into the warm and inviting aroma of The Magic Bakery, where the sweet scent of sugar and spices fills the air. As you walk through the doorway, a tiny baker greets you with a smile and whispers, \"Welcome, young adventurer! I have a special treat just for you.\" You look around at rows of colorful cupcakes, shimmering cookies, and towering cakes that seem to stretch up to the ceiling.\nPlease choose to either head down into 🍷 The Secret Magical Cellar, where ancient recipes are said to be hidden in dusty jars, or wander through 🌹 The Enchanted Garden Maze, where flowers bloom with flavors of your favorite treats."
},
"wizard_tower": {
"story_key": "wizard_tower",
"title": "🏰 The Wise Wizard's Tower",
"requires_items": [
"golden_coin"
],
"connections": [
"spell_room",
"library",
"old_tree"
],
"item_reward": "crystal_compass",
"story": "You stand before the towering spire of The Wise Wizard's Tower, its stone walls shimmering with a soft, ethereal glow. As you push open the creaky door, a warm golden light spills out, inviting you to enter. You feel a thrill of excitement as you step into the tower, surrounded by shelves and tables cluttered with ancient tomes, mysterious artifacts, and sparkling crystals.\nPlease choose to either head into ⚑ The Mystical Spell Room, where the wizard's most powerful incantations are said to be stored, or wander through πŸ“š The Ancient Magic Library, which is rumored to hold secrets of the past. Alternatively, you might want to visit 🌳 The Ancient Talking Tree, a wise and gentle guardian who whispers ancient wisdom to those who listen carefully."
},
"tree_house": {
"story_key": "tree_house",
"title": "🏠 The Cozy Tree House",
"requires_items": [
"crystal_compass"
],
"connections": [
"fairy_glade"
],
"item_reward": "fairy_dust",
"story": "You step into 🏠 The Cozy Tree House, where the tree's whispers have mentioned a warm and inviting home filled with books and cozy nooks. As you enter, the door creaks open by itself, revealing a room full of twinkling lights and soft cushions. Suddenly, you hear a faint humming noise coming from upstairs - could it be the legendary Tree Whisperer who lives here?\nPlease choose to either visit 🧚 The Sparkling Fairy Glade, where the fairies are known to have secret parties under the sparkling moonlight, or head into your own room in The Cozy Tree House, where you might discover more secrets about this magical place."
},
"underground_cave": {
"story_key": "underground_cave",
"title": "πŸ•³οΈ The Glowing Underground Cave",
"requires_items": [],
"connections": [
"crystal_chamber"
],
"item_reward": "ancient_map",
"story": "You step into πŸ•³οΈ The Glowing Underground Cave, and immediately notice that the walls are shimmering with a soft blue light. As you wander deeper into the cave, you start to hear the faint humming of tiny insects, their bioluminescent bodies lighting up the darkness like tiny stars. Suddenly, a swarm of sparkling fireflies flit around your head, leading you towards a secret path that disappears into the distance.\nPlease choose to either follow the shimmering trail that leads out of The Glowing Underground Cave and into πŸ’Ž The Hidden Crystal Chamber or stay awhile in the cave and see if you can find more hidden wonders within."
},
"stone_bridge": {
"story_key": "stone_bridge",
"title": "πŸŒ‰ The Ancient Stone Bridge",
"requires_items": [],
"connections": [
"mountain_peak"
],
"item_reward": "stone_tablet",
"story": "As you step onto the ancient stone bridge, you feel the magic of centuries past beneath your feet. The stones seem to hum with an otherworldly energy, and the wind whispers secrets in your ear as you walk across. Suddenly, a shimmering light appears at the far end of the bridge, beckoning you towards it.\nPlease choose to either continue on the bridge, following the light into the unknown, or head towards ⛰️ The Majestic Mountain Peak, where rumors of hidden treasures and ancient ruins await discovery."
},
"secret_cellar": {
"story_key": "secret_cellar",
"title": "🍷 The Secret Magical Cellar",
"requires_items": [],
"connections": [
"crystal_chamber"
],
"item_reward": null,
"story": "You push open the creaky door and step into 🍷 The Secret Magical Cellar, where ancient bottles of sparkling potion line the shelves. As you wander through the dusty aisles, the air fills with a sweet scent that makes your heart skip a beat. You stumble upon a mysterious map etched on the wall, leading to two possible paths.\nPlease choose to either follow the winding staircase down into 🍷 The Secret Magical Cellar's hidden depths or slip into πŸ’Ž The Hidden Crystal Chamber, where legends say crystals whisper secrets to those who listen carefully."
},
"garden_maze": {
"story_key": "garden_maze",
"title": "🌹 The Enchanted Garden Maze",
"requires_items": [
"magic_flour"
],
"connections": [
"fairy_glade"
],
"item_reward": "rainbow_flower",
"story": "You enter the Enchanted Garden Maze, and as you wander through its winding paths, vibrant flowers bloom at your feet, filling the air with sweet scents. You follow a trail of sparkling fairy dust that leads you deeper into the maze, where ancient trees whisper secrets in the breeze. Suddenly, the path splits into three distinct routes: to the left, towards the misty morning glade; straight ahead, through the sun-drenched wildflower meadow; or right, into the shadowy twilight woods.\nPlease choose to either visit 🧚 The Sparkling Fairy Glade, where delicate fairy wings shimmer in the sunlight and playful creatures frolic among the flowers, or head towards the misty morning glade."
},
"spell_room": {
"story_key": "spell_room",
"title": "⚑ The Mystical Spell Room",
"requires_items": [],
"connections": [
"mountain_peak"
],
"item_reward": "magic_wand",
"story": "You step into ⚑ The Mystical Spell Room, and suddenly you're surrounded by swirling clouds of sparkling dust that make your heart skip a beat. The air is filled with whispers of ancient magic, and you can feel the room's secrets stirring within you. As you reach out to touch a glittering crystal on a nearby shelf, it shatters into a thousand sparkling shards, releasing a burst of enchanted energy!\nPlease choose to either follow the shimmering trail of sparks that leads up to ⛰️ The Majestic Mountain Peak or journey through the wispy clouds that are said to conceal hidden pathways and secret messages."
},
"library": {
"story_key": "library",
"title": "πŸ“š The Ancient Magic Library",
"requires_items": [],
"connections": [
"crystal_chamber"
],
"item_reward": "wisdom_scroll",
"story": "You step into the grand halls of πŸ“š The Ancient Magic Library, where ancient tomes whisper secrets on their shelves. As you wander through the narrow aisles, you discover a hidden room filled with glowing scrolls that seem to dance in mid-air! You can feel the magic coursing through your fingers as you reach out to touch one.\nPlease choose to either explore the mysterious scrolls further or head into the sparkling light of πŸ’Ž The Hidden Crystal Chamber."
},
"fairy_glade": {
"story_key": "fairy_glade",
"title": "🧚 The Sparkling Fairy Glade",
"requires_items": [],
"connections": [
"rainbow_pool"
],
"item_reward": null,
"story": "You step into the Sparkling Fairy Glade, and instantly you're surrounded by a kaleidoscope of colors and twinkling lights. The fairies flit about, their delicate wings shimmering as they weave spells of wonder through the air. As you breathe in the sweet scent of enchanted flowers, you feel your heart fill with magic!\nPlease choose to either explore <locations>🌈 The Rainbow Reflection Pool</locations>, where ripples on the water create a mesmerizing display of colors and patterns, or venture deeper into the Sparkling Fairy Glade, where hidden pathways whisper secrets to those who wander through."
},
"crystal_chamber": {
"story_key": "crystal_chamber",
"title": "πŸ’Ž The Hidden Crystal Chamber",
"requires_items": [
"ancient_map",
"wisdom_scroll"
],
"connections": [
"rainbow_pool"
],
"item_reward": "master_key",
"story": "You step into the Hidden Crystal Chamber, and your eyes widen as you gaze upon a dazzling array of glittering crystals suspended from the ceiling like a rainbow-colored chandelier. A soft hum emanates from the crystals, filling the air with an otherworldly music that makes your heart sing! As you wander deeper into the chamber, the crystal walls begin to shimmer and glow, beckoning you to explore further.\nPlease choose to either visit 🌈 The Rainbow Reflection Pool, where the waters are said to reveal hidden secrets and mystical patterns."
},
"mountain_peak": {
"story_key": "mountain_peak",
"title": "⛰️ The Majestic Mountain Peak",
"requires_items": [
"stone_tablet",
"magic_wand"
],
"connections": [
"rainbow_pool"
],
"item_reward": null,
"story": "You climb up the majestic mountain peak, feeling the rush of wind in your face as you reach the top. There, you discover a secret cave hidden behind a waterfall, where glittering crystals and shimmering fabrics hang from the ceiling like a magical palace. As you step inside, you feel the soft whisper of ancient songs that seem to awaken the crystals themselves!\nPlease choose to either visit 🌈 The Rainbow Reflection Pool, where the pool's waters are said to reflect the colors of your deepest dreams, or stay in this enchanted cave and try to learn more about its mysterious melodies."
},
"rainbow_pool": {
"story_key": "rainbow_pool",
"title": "🌈 The Rainbow Reflection Pool",
"requires_items": [],
"connections": [
"victory"
],
"item_reward": null,
"story": "You've finally arrived at the magnificent 🌈 Rainbow Reflection Pool, where the waters shimmer and dance with colors of the rainbow. As you dip your toes into the pool, you feel a strange tingling sensation, and suddenly, you're surrounded by a kaleidoscope of colors that seem to come alive! The pool's magic is calling out to you - will you follow its whispers to πŸ† Victory! The Forest is Saved!\nPlease choose to either:\nvisit πŸ† Victory! The Forest is Saved!, where the forest creatures are celebrating their victory over darkness, or\nhead back into your own world, where a new adventure awaits."
},
"victory": {
"story_key": "victory",
"title": "πŸ† Victory! The Forest is Saved!",
"requires_items": [],
"connections": [],
"item_reward": null,
"story": "You stand amidst the vibrant colors of the forest, surrounded by ancient trees that now bloom with joyous flowers. The air is filled with sweet music as the creatures of the forest gather around you to celebrate your bravery in defeating the dark sorcerer who threatened their home. With a triumphant shout, they lift you onto their shoulders and begin to carry you towards the grand ceremony awaiting you at the heart of the forest.\nPlease choose to either walk alongside the procession through the Luminous Meadow, where soft grasses reflect the colors of the rainbow, or head straight into the Grand Oak Plaza, where a majestic tree awaits with secrets to share about the ancient magic that saved the forest."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment