
Mystic Forest Flow
Mystic Forest Flow is an adventure that generates a story based on your choices.
Demo
About
# 🌲 Mystic Forest Flow - Interactive Blockchain Adventure An interactive text-based adventure game with AI-generated images and Flow blockchain integration. Make choices that shape your destiny and save your story outcomes on the blockchain! ## ✨ Features - **🎮 Interactive Storytelling**: Choice-based gameplay with branching narratives - **🎨 AI-Generated Images**: Dynamic images for each scene using Pollinations.ai - **⛓️ Blockchain Integration**: Save story outcomes on Flow blockchain - **🏆 Multiple Endings**: Different endings based on your choices and score - **📱 Responsive Design**: Works on desktop and mobile devices - **🔗 MetaMask Integration**: Seamless wallet connection and network switching ## 🚀 Live Demo [Play the Game](https://your-vercel-url.vercel.app) | [View on GitHub](https://github.com/yourusername/mystic-forest-flow) ## 🎯 ETHGlobal Submission This project is built for **ETHGlobal New Delhi 2025** and targets the **Flow Foundation's $10,000 prize** for gaming applications. ## 🛠️ Tech Stack - **Frontend**: HTML, CSS, JavaScript, Ethers.js - **Backend**: Python Flask - **Blockchain**: Flow EVM (Ethereum-compatible) - **Smart Contract**: Solidity - **Image Generation**: Pollinations.ai API - **Deployment**: Vercel ### Blockchain Setup 1. **Install MetaMask** browser extension 2. **Add Flow Testnet** to MetaMask: - Network Name: Flow - RPC URL: `https://testnet.evm.nodes.onflow.org` - Chain ID: `545` - Currency: FLOW 3. **Get test tokens** from [Flow Testnet Faucet](https://testnet-faucet.onflow.org/) ## 🎮 How to Play 1. **Start your adventure** in the mysterious forest 2. **Make choices** that affect your story path and score 3. **Watch AI-generated images** for each scene 4. **Reach an ending** based on your decisions 5. **Save to blockchain** to permanently store your story 6. **Share your adventure** with friends ## 🏗️ Project Structure ``` mystic-forest-flow/ ├── api/ │ └── index.py # Flask backend server ├── public/ │ ├── index.html # Main game page │ ├── script.js # Frontend JavaScript │ ├── style.css # Game styling │ └── ethers-offline.js # Offline ethers.js fallback ├── ForestAdventure.sol # Smart contract ├── forest-adventure.js # Contract interaction ├── requirements.txt # Python dependencies ├── vercel.json # Vercel configuration └── README.md # This file ``` ## 🔧 Smart Contract The game uses a Solidity smart contract deployed on Flow testnet: - **Contract Address**: `0xafa6C385c1B6D26Fda55f1a576828B75E9F9FD6c` - **Functions**: `createStoryOutcome`, `getStoryOutcome`, `getTotalStories` - **Events**: `StoryCreated`, `StoryUpdated` ### What Gets Stored Each story outcome includes: - Story ID and ending category - Player's final score - Generated image URLs - Player's wallet address - Timestamp
How it's made
This uses Pollinations to get the images, we have integrated the smart contracts on Flow - Flow EVM (Ethereum-compatible), and also used filecoin for storage. the part where the integration of image and generation of a new story took a long time. Flow Integration and deployment of smart contract was a easy process with well documented structure and videos that helped a lot