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
- **Install MetaMask** browser extension
- **Add Flow Testnet** to MetaMask:
- Network Name: Flow
- RPC URL: `https://testnet.evm.nodes.onflow.org`
- Chain ID: `545`
- Currency: FLOW
- **Get test tokens** from [Flow Testnet Faucet](https://testnet-faucet.onflow.org/)
## ๐ฎ How to Play
- **Start your adventure** in the mysterious forest
- **Make choices** that affect your story path and score
- **Watch AI-generated images** for each scene
- **Reach an ending** based on your decisions
- **Save to blockchain** to permanently store your story
- **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
From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.






