Skip to content

juli-dot-md/rogue-vibe

Repository files navigation

▒▒▒ R O G U E ░░ V I B E ▒▒▒

🎮 The Ultimate Genre-Switching Roguelite

"What if we threw EVERY genre at an AI agent and demanded it make a game with TDD?"

This happened. And it's GLORIOUS.


🚀 Project Context

Built at: codecentric - Innovation Leaders in AI-Powered Development
Event: AI Powered Working - Exploring the Future of AI-Augmented Software Development
Tech Stack: Claude Sonnet 4.5 + OpenCode AI Coding Agent
Approach: 100% AI-Assisted Development using Test-Driven Development (TDD)

This game is a live demonstration of:

  • 🤖 AI-First Development - Built entirely through Claude + OpenCode pair programming
  • 🎯 Software Craftsmanship - TDD, Clean Code, and rigorous quality standards
  • 🧠 Augmented Intelligence - Human creativity + AI execution = Rapid innovation
  • 🔥 Vibecoding Philosophy - "Try weird ideas immediately, keep what's fun"
  • 🛠️ Modern AI Tooling - Leveraging state-of-the-art LLM and autonomous coding agent

The Experiment: Can Claude Sonnet 4.5 working through OpenCode build a complex, multi-genre game following strict TDD principles? Can it refactor fearlessly? Can it handle scope creep while maintaining quality?

The Answer: You're looking at it. 🎪

Why This Matters

This isn't just a game - it's proof of concept for:

  • AI agents as effective pair programmers for complex projects
  • TDD as a forcing function for AI to write better code
  • Human-AI collaboration on creative, unstructured problems
  • Rapid prototyping without sacrificing code quality

codecentric's Mission: Pioneering AI-powered workflows that make developers more productive, creative, and effective. This project showcases what's possible when you combine human vision with AI execution, all while maintaining craftsmanship standards.


📋 Development Rules & Guidelines

This project follows strict TDD and software craftsmanship principles. The rules/ folder contains AI agent guidelines that enforce best practices:

Core Development Principles

🔴 🟢 🔄 Test-Driven Development (rules/tdd.mdc)

  • RED → GREEN → REFACTOR cycle for all features
  • Test list first (base functionality only)
  • One test at a time (no multiple active tests)
  • "Guessing Game" - predict failures before running tests
  • Baby steps - minimal code to pass each test
  • Mandatory refactoring after green phase

🎯 Simple Design (rules/simple-design.mdc)

  • Kent Beck's Four Rules (priority order):
    1. Tests Pass - highest priority, never compromise
    2. Reveals Intent - clear, self-documenting code
    3. No Duplication (DRY) - extract common functionality
    4. Fewest Elements - minimize complexity

⚖️ Code Quality Metrics (rules/absolute-priority-premise.mdc)

  • Micah Martin's Absolute Priority Premise (APP)
  • Assigns "mass" to code components (lower = better)
  • Mass values: Constants (1), Bindings (1), Invocations (2), Conditionals (4), Loops (5), Assignments (6)
  • Use during refactoring to guide toward simpler solutions
  • Favor functional approaches over imperative

🤝 Human-in-the-Loop TDD (rules/human-in-the-loop.mdc)

  • End-of-phase confirmation (Red, Green, Refactor)
  • Explicit permission required before proceeding
  • Failed prediction recovery protocol
  • Maintains human agency in development process

📝 TypeScript Standards (rules/typescript-development.mdc)

  • Explicit .js file extensions for ESNext modules
  • Vitest for unit testing (not Jest)
  • .spec.ts extension for test files (tests are specifications)

Why These Rules Matter

These aren't just guidelines - they're enforced disciplines that:

  • ✅ Enable fearless refactoring with test safety nets
  • ✅ Prevent over-engineering and premature optimization
  • ✅ Create living documentation through tests
  • ✅ Build confidence through explicit predictions
  • ✅ Maintain code simplicity through objective metrics

Note: This project was built entirely using these principles. Every feature has tests. Every refactor was measured. Every step was validated.


🎯 The Vision

An over-the-top roguelite where you loop through wildly different game genres:

Space InvadersSidescroll ShooterJRPG CombatRepeat Forever (Getting Harder)

Each genre has unique mechanics, genre-specific upgrades, and boss fights. Between runs, visit charming shopkeepers, build relationships, unlock romance bonuses, and buy permanent upgrades.

Core Loop: 10-15 minute runs. Infinite difficulty scaling. Permanent progression. Pure chaos.


🎪 The Story: How This Game Was Made

Act 1: "Just Make Space Invaders"

Human: "Make a simple Space Invaders clone with tests."

AI Agent:Creates functional Space Invaders with TDD

  • Classic top-down shooter
  • Aliens that move and shoot
  • Player movement and shooting
  • Collision detection
  • Full test coverage

Human: "Cool. Now add a boss fight."

AI:Adds boss with random traits from a pool of 10

  • Laser beams, homing missiles, teleportation, shields...
  • Boss gets procedurally generated abilities

Act 2: "What If We Added... Everything?"

Human: "Now add a shop system. With permanent upgrades."

AI:Creates shop with 19 upgrades

  • Extra lives, spread shot, speed boost, shields...
  • Coin currency system
  • Persistent save data

Human: "Actually, make the shopkeeper romanceable."

AI:Creates relationship/hearts system

  • 5 unique shopkeepers with personalities
  • Romance unlocks at 5 hearts
  • Dating mini-game with bonuses

Human: "Add 4 more shopkeepers. All romanceable."

AI:Creates Zara, Blorp, Gleep, Xylara, and Boltz

  • Each with unique dialogue
  • Individual relationship tracking
  • Bonus abilities when romanced

Act 3: "Genre Switching? Sure, Why Not!"

Human: "Now add a sidescroll shooter mode."

AI: 😅 Creates entire sidescroll system

  • Horizontal movement
  • Enemies spawn from right
  • Different physics
  • Time-limited survival mode

Human: "And a JRPG combat system."

AI: 😰 Implements turn-based RPG

  • Attack, Defend, Skills
  • Enemy AI
  • Multi-enemy battles
  • Boss phases with scaling damage

Human: "Make it loop through all 3 genres."

AI: 🤯 Creates 9-wave system

  • Waves 1-3: Space Invaders + Boss
  • Waves 4-6: Sidescroll + Boss
  • Waves 7-9: JRPG + Final Boss
  • Victory screen, then loop restart

Act 4: "Make It Scalable"

Human: "Refactor this so we can easily add more genres."

AI: 🧠 Creates genre-agnostic architecture

  • game_architecture.py - Section/Genre system
  • Difficulty scaling framework
  • Genre-specific upgrade registry
  • Infinite loop support

Current Status: Foundation for 10+ genres, all driven by TDD


🎮 What Makes This Special

1. TDD From Day 1

Every feature test-first:

  • 89+ unit tests covering core systems
  • Integration tests for gameplay
  • Automated bot playtesting
  • RED → GREEN → REFACTOR cycle throughout

2. Vibecoding Philosophy

  • "Try this weird idea" → Build it → Ship it
  • Romance shopkeepers? Sure!
  • Control inversion debuff? Why not!
  • Dating mini-game? Absolutely!

3. Genre Mashup Chaos

The absurdity is the point:

  • Space Invaders → suddenly JRPG combat
  • Boss has laser beams → now it's turn-based attacks
  • Strategic depth from genre variety

4. Surprisingly Deep Systems

Despite chaotic dev process:

  • Combo multiplier system
  • Permanent meta-progression
  • Relationship system with meaningful bonuses
  • Difficulty scaling across infinite loops

🎯 Current State

✅ What Works

  • 3 Complete Genres: Invaders, Sidescroll, JRPG
  • Loop System: Waves 1-9 with boss fights
  • Shop System: 43 permanent upgrades
  • Romance System: 5 unique NPCs with bonuses
  • Save System: Persistent progression
  • TDD Coverage: 89+ passing tests

🚧 Known Issues (Being Fixed)

  1. No Difficulty Scaling - Loop 1 = Loop 10 (fix in progress)
  2. Romance Design Flaw - Can't romance all 5 (tip jar fix ready)
  3. Victory Screen UX - Feels like "game over" not "continue" (improving)

🔮 Planned Features

  • Difficulty Scaling: Each loop gets 50% harder
  • Genre-Specific Upgrades: Different builds per genre
  • New Genres: Tower Defense, Bullet Hell, Rhythm Game
  • Meta-Progression: Unlock new genres by looping
  • Polish: Screen shake, particles, juice

📂 Project Structure

├── game.py                    # Main game class (Arcade framework)
├── space_invaders.py          # Core game logic (pure functions)
├── game_architecture.py       # NEW: Scalable genre system
├── sprites.py                 # Custom sprite generation
├── test_space_invaders.py     # 89+ unit tests
├── tests/                     # All test files
├── bots/                      # AI playtesting bots
│
├── tasks/                     # Agent task files
│   ├── task_1_1_difficulty_scaling.md
│   ├── task_1_2_tip_jar.md
│   └── task_1_3_victory_ux.md
│
├── TDD_ACTION_PLAN.md         # Development roadmap
├── GAME_VISION.md             # Design document
├── REFACTORING_GUIDE.md       # Architecture guide
└── README.md                  # This file

🚀 Quick Start

Play the Game

# Install dependencies
pip install arcade pillow

# Run the game
python game.py

# Controls
Arrow Keys: Move
Space: Shoot
SHIFT: Bullet time (if unlocked)

Development Workflow (TDD)

# 1. Write failing test
pytest test_space_invaders.py -v  # Watch it fail (RED)

# 2. Implement feature
# ... write minimal code ...

# 3. Run tests
pytest test_space_invaders.py -v  # Watch it pass (GREEN)

# 4. Refactor
# ... improve code quality ...

# 5. Verify still green
pytest test_space_invaders.py -v  # Confirm still passing

Run Automated Playtester

# Run bot stress test
python bots/autoplay_bot_full.py --time 900

🎯 For AI Agents: Pick Up Where We Left Off

Next Tasks (Ready to Implement)

Priority 1: Fix Critical Flow Breaks

  1. tasks/task_1_1_difficulty_scaling.md
    Implement loop difficulty scaling (2-3 hours)

  2. tasks/task_1_2_tip_jar.md
    Fix romance system (30 minutes)

  3. tasks/task_1_3_victory_ux.md
    Improve victory screen UX (1 hour)

Priority 2: Genre Depth 4. Implement genre-specific upgrades 5. Add JRPG skills system 6. Create meta-progression unlocks

Priority 3: New Genres 7. Tower Defense mode 8. Bullet Hell mode 9. Rhythm Game mode

See TDD_ACTION_PLAN.md for detailed implementation plans.


🧪 Testing

# Run all tests
pytest -v

# Run specific test file
pytest test_space_invaders.py -v

# Run with coverage
pytest --cov=. --cov-report=html

# Run integration tests
python test_gameplay.py

# Run bot stress test
python autoplay_bot_full.py --time 900

Current Test Stats:

  • ✅ 89+ unit tests
  • ✅ 14/14 integration tests
  • ✅ 100% critical path coverage
  • ✅ Bot validates full playthrough

🎨 Design Philosophy

1. Embrace the Chaos

Don't apologize for genre switching - celebrate it!

  • Make transitions dramatic
  • Add self-aware humor
  • Reward mastering all genres

2. TDD Enables Fearless Refactoring

  • Write test first
  • Implement minimal code
  • Refactor without fear
  • Ship with confidence

3. Vibecoding = Fun Development

  • Try weird ideas immediately
  • Prototype rapidly
  • Keep what's fun
  • Cut what's boring

4. Respect Player Time

  • Quick runs (10-15 min)
  • Permanent progression
  • Clear goals
  • Immediate feedback

📊 Stats

Development:

  • Lines of Code: ~8000+
  • Test Coverage: 89+ tests
  • Genres Implemented: 3 (6+ planned)
  • Shopkeepers: 5 romanceable NPCs
  • Upgrades: 43 permanent items
  • Development Time: ~40 hours (including rewrites)
  • Times Refactored: Too many to count

Game Content:

  • Waves: 9 per loop
  • Boss Fights: 3 per loop
  • Enemy Types: 4 variants
  • Romance Dialogues: 30+ unique lines
  • Powerup Types: 10+
  • Difficulty Loops: Infinite

🎭 The Shopkeepers

Meet the cast:

  • Zara 💙 - The Cosmic Merchant (Enthusiastic haggler)
  • Blorp 🎩 - Tentacled Trader (Sophisticated octopus)
  • Gleep 😤 - The Tiny Tyrant (Sassy, sarcastic)
  • Xylara 🔮 - The Mysterious (Mystical fortune teller)
  • Boltz 🤖 - RoboMerchant (Cheerful AI)

Each has unique dialogue, personality, and romance bonus!


🌟 Future Vision

Phase 1: Polish Core (Weeks 1-2)

  • Difficulty scaling
  • Genre-specific upgrades
  • UI improvements
  • Balance pass

Phase 2: Content Expansion (Weeks 3-6)

  • Tower Defense genre
  • Bullet Hell genre
  • Rhythm Game genre
  • Boss Rush mode
  • Endless mode

Phase 3: Meta Systems (Weeks 7-8)

  • Achievement system
  • Unlock progression
  • Daily challenges
  • Leaderboards

Phase 4: Launch (Week 9+)

  • Sound effects & music
  • Visual effects polish
  • Marketing assets
  • Steam release?

💡 Lessons Learned

What Worked

TDD from day 1 - Refactored fearlessly
Pure functions - Easy to test, easy to compose
Genre modularity - Can add new genres easily
AI pair programming - Rapid prototyping
Vibecoding mindset - Kept development fun

What Was Hard

😅 Scope creep - "Just one more feature..."
😅 Genre coordination - 3 different control schemes
😅 Balance - Romance system had design flaw
😅 State management - Many game states to juggle

What Was Surprising

🎉 Romance system popularity - Most loved feature!
🎉 Bot revealed bugs - Automated testing is gold
🎉 Test coverage confidence - Refactor anything anytime
🎉 Genre switching works - Players love the chaos


🤝 Contributing

This game is TDD-driven. All contributions MUST include tests.

  1. Pick a task from tasks/ directory
  2. Read TDD_ACTION_PLAN.md for that task
  3. Follow RED → GREEN → REFACTOR cycle
  4. Write tests FIRST
  5. Submit PR with test coverage

No tests = No merge


📜 License

MIT License - Do whatever you want with this code!

But seriously, if you make something cool with this, let me know. I want to see your 20-genre roguelite. 🚀


🎮 Play It, Break It, Build On It

This game is:

  • ✅ A working roguelite
  • ✅ A TDD showcase
  • ✅ A vibecoding experiment
  • ✅ A genre mashup playground
  • ✅ An AI-assisted dev story

What started as "make Space Invaders with tests" became a genre-bending roguelite with romance mechanics.

That's the power of:

  1. Test-Driven Development
  2. Fearless refactoring
  3. Saying "yes" to weird ideas
  4. AI-assisted rapid prototyping

Want to add a Dating Sim genre? Do it.
Want to add a Cooking Mama section? Go for it.
Want to make the shopkeeper a boss fight? ABSOLUTELY.

The architecture supports it. The tests protect you. The vision is open.

Go forth and vibe code.


Built with TDD, refined through vibecoding, and powered by the question:
"What if we just... threw every genre at this thing?"

The answer: This game. And it's only getting weirder. 🎪

About

Rogue-Vibe - A genre-switching roguelite built 100% with AI pair programming (Claude Sonnet 4.5 + OpenCode) using strict TDD. Loop through Space Invaders → Sidescroll → JRPG combat with romance-able shopkeepers. Proof-of-concept for AI-augmented software craftsmanship.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages