Skip to content

AIEngineerX/BagsWorldRPG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

BagsWorld RPG

A Pokemon-style RPG integrated into BagsWorld, featuring AI-powered NPC dialogue and battle commentary powered by Claude.

Features

  • 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

Installation

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

Dependencies

Requires these packages (likely already in BagsWorld):

  • phaser - Game engine
  • zustand - State management
  • next - React framework

Optional:

  • ANTHROPIC_API_KEY env var for AI-powered dialogue (falls back to static dialogue)

Usage

  1. Copy files to your project
  2. Run npm run dev
  3. Navigate to /rpg

Controls

Key Action
Arrow Keys Move
Z / Enter Confirm / Interact
X / Backspace Cancel / Back
ESC Open Menu

Creatures

Starters

Name Type Theme
Seedbag Grass Growing portfolio
Burnchar Pump Green candles, gains
Liquidle Liquidity Pool liquidity

Wild (Route 1)

  • Pumpachu (Fast) - Solana speed
  • Rattata (Normal) - Common trader
  • Dogenite (Normal) - Original meme

Boss

  • Ruggengar (FUD) - Ghost of rugged traders

Type Effectiveness

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)

Game Flow

  1. Start in Bags Town
  2. Visit Professor Toly to get starter
  3. Head south to Route 1
  4. Battle wild creatures and trainers
  5. Challenge Gym Leader Finn
  6. Earn the Bags Badge!

Architecture

  • 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

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors