A Pokemon-style RPG integrated into BagsWorld, featuring AI-powered NPC dialogue and battle commentary powered by Claude.
- 13 Bags Creatures - Crypto/memecoin themed creatures including 3 starter evolution lines
- Turn-based Combat - Classic Pokemon-style battle system with type effectiveness
- AI-Powered NPCs - Claude generates dynamic dialogue for NPCs
- 3 Maps - Bags Town, Route 1, and Finn's Gym
- Procedural Sprites - All pixel art generated at runtime via Phaser
Copy these files into your existing BagsWorld/Next.js project:
src/
├── app/
│ ├── rpg/page.tsx # RPG game page
│ └── api/rpg/
│ ├── ai-dialogue/route.ts # Claude NPC dialogue
│ ├── battle/route.ts # Battle narration
│ └── save/route.ts # Save/load
├── game/scenes/rpg/
│ ├── RPGBootScene.ts # Asset loading & generation
│ ├── OverworldScene.ts # Tile movement, NPCs
│ ├── BattleScene.ts # Turn-based combat
│ ├── DialogueScene.ts # Text boxes
│ └── MenuScene.ts # Party, items, save
├── rpg/
│ ├── types.ts # TypeScript definitions
│ ├── data/
│ │ ├── creatures.json # 13 Bags Creatures
│ │ ├── moves.json # 20 moves
│ │ ├── types.json # Type matchups
│ │ └── maps.json # Map definitions
│ ├── engine/
│ │ ├── battle-engine.ts # Damage calc, stats
│ │ ├── encounter-system.ts # Wild encounters
│ │ └── type-effectiveness.ts # Type matchups
│ └── ai/
│ ├── dialogue-generator.ts # Claude wrapper
│ └── battle-narrator.ts # AI commentary
├── components/rpg/
│ └── RPGCanvas.tsx # Phaser mount
└── lib/
└── rpg-store.ts # Zustand state
Requires these packages (likely already in BagsWorld):
phaser- Game enginezustand- State managementnext- React framework
Optional:
ANTHROPIC_API_KEYenv var for AI-powered dialogue (falls back to static dialogue)
- Copy files to your project
- Run
npm run dev - Navigate to
/rpg
| Key | Action |
|---|---|
| Arrow Keys | Move |
| Z / Enter | Confirm / Interact |
| X / Backspace | Cancel / Back |
| ESC | Open Menu |
| Name | Type | Theme |
|---|---|---|
| Seedbag | Grass | Growing portfolio |
| Burnchar | Pump | Green candles, gains |
| Liquidle | Liquidity | Pool liquidity |
- Pumpachu (Fast) - Solana speed
- Rattata (Normal) - Common trader
- Dogenite (Normal) - Original meme
- Ruggengar (FUD) - Ghost of rugged traders
| Type | Strong Against | Weak Against |
|---|---|---|
| PUMP | Grass, FUD | Pump, Liquidity |
| LIQUIDITY | Pump | Liquidity, Grass |
| GRASS | Liquidity | Pump, Grass |
| FAST | Liquidity | Grass, Fast |
| FUD | FUD | Normal (immune) |
- Start in Bags Town
- Visit Professor Toly to get starter
- Head south to Route 1
- Battle wild creatures and trainers
- Challenge Gym Leader Finn
- Earn the Bags Badge!
- 240x160 GBA-style resolution scaled 3x
- Phaser 3 for game engine
- Zustand for state management
- Claude Haiku for NPC dialogue (fast, cheap)
- localStorage for save data
MIT