Skip to content

Repository files navigation

🧠 BrainRot Games

A web platform for comparing fun, cool-looking AI-generated games. Play each version side-by-side and judge which model makes the best actual game experience — not the biggest pile of UI chrome.

Live at: sasler-brainrotgames.vercel.app
Repo: github.com/sasler/BrainRot

🎮 Games

Game Description Versions
🐍 Snake Navigate the serpent through a digital grid. Consume pixels to grow, but one wrong move means total annihilation. 9
👻 Pac-Man Dash through a neon maze, gobble pellets, outsmart relentless ghosts, and flip the hunt with power surges. 4
💣 Minesweeper Every click is a calculated gamble. Use logic to uncover safe tiles while avoiding hidden explosives. 5
🧱 Tetris Falling tetrominoes demand split-second decisions. Stack them perfectly or watch entropy consume the board. 6
⚫ Reversi A war of strategic placement. Flip your opponent's pieces and dominate the 8×8 battlefield. 6
🏓 Breakout Shatter neon bricks with a blazing ball. Catch power-ups, chain combos, and clear every level before your lives run out. 7
🔢 2048 Slide, merge, and strategize on a 4×4 grid. Chase the elusive 2048 tile before the board fills up. 7
🏃 Endless Runner 3D A neon-soaked 3D sprint through an endless cyberpunk corridor with obstacles, collectibles, and power-ups. 6
🔮 Marble Madness Roll a glowing marble across neon platforms suspended in space. Master physics, dodge hazards, and race the clock. 6
🧭 3D Maze Navigate a procedurally generated labyrinth in first-person 3D. Find the glowing exit before time runs out. 8
⛳ Mini Golf 3D Aim, pull back, and sink impossible banks across neon-drenched 3D mini golf courses, including a nine-hole solar eclipse odyssey. 5
💎 Tile Matching Swap, match, and chain your way to the top. Line up three or more gems to trigger cascading combos and dazzling special tiles. 8
👾 Space Invaders Defend Earth from waves of descending alien invaders. Blast through formations, grab power-ups, and survive the onslaught. 5
🔢 Sudoku Solve a glowing logic grid under pressure with notes, streaks, and satisfying neon feedback for every sharp deduction. 2
🏎️ Neon Horizon Racer Drift through a neon synthwave highway, dodge traffic, chain near misses, and chase checkpoints into the glowing horizon. 6
🏎️ Coastal Rush '86 Race a red convertible through a branching, sun-soaked 1980s arcade road trip before the clock runs out. 7
🕰️ Clockwork Caper Stage perfect heists across a clockwork museum by recording echoes of your past actions, outsmarting guards, and escaping before the final chime. 3
🏁 Sunbeam Kart Rally Charge through a three-lap golden-hour festival circuit, drift past orchards, a windmill, forest, and vineyards, and battle up to five rivals with sun-powered items. 2
🛰️ Perihelion Post Fly the mail through a brass orrery on real orbital mechanics, plotting a live course through worlds that will not hold still for you. 1

🤖 Competing AI Models

Model Snake Minesweeper Tetris Reversi Breakout 2048 Endless Runner Marble Madness 3D Maze Mini Golf 3D Tile Matching Space Invaders Pac-Man Sudoku Neon Horizon Racer Coastal Rush '86 Clockwork Caper Sunbeam Kart Rally Perihelion Post
Claude Fable 5 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 2,108 lines N/A N/A N/A
Claude Opus 4.6 852 lines 1,009 lines 1,166 lines 1,467 lines 1,133 lines 984 lines 1,092 lines 1,101 lines 1,162 lines 1,347 lines 1,820 lines 1,547 lines N/A N/A N/A N/A N/A N/A N/A
Claude Opus 4.8 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 1,417 lines N/A N/A N/A
Claude Opus 5 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 4,648 lines N/A N/A N/A 2,920 lines N/A N/A 3,321 lines 3,570 lines
Claude Sonnet 4.6 828 lines 809 lines 973 lines 1,167 lines 900 lines 727 lines 1,108 lines 1,384 lines 1,313 lines 1,362 lines 1,239 lines 1,203 lines 937 lines 814 lines 1,450 lines N/A N/A N/A N/A
OpenAI GPT 5.4 1,763 lines 1,875 lines 2,278 lines 1,482 lines 1,419 lines 779 lines 1,960 lines 2,279 lines 1,837 lines 2,401 lines 2,852 lines 3,116 lines 2,135 lines 3,371 lines N/A 3,093 lines N/A N/A N/A
OpenAI GPT 5.5 N/A N/A N/A N/A N/A 2,031 lines 2,369 lines N/A N/A N/A 2,413 lines 1,643 lines 2,058 lines N/A 1,398 lines 2,155 lines N/A N/A N/A
OpenAI GPT 5.6 Terra N/A N/A N/A N/A N/A N/A N/A N/A 930 lines N/A N/A N/A N/A N/A N/A N/A 147 lines N/A N/A
OpenAI GPT 5.6 Luna N/A N/A 1,444 lines N/A 492 lines N/A N/A N/A N/A N/A 893 lines N/A N/A N/A N/A N/A 289 lines N/A N/A
OpenAI GPT 5.6 Sol N/A N/A N/A 1,736 lines N/A N/A N/A 304 lines 2,421 lines 2,134 lines 3,263 lines N/A N/A N/A 278 lines 1,542 lines 2,447 lines 715 lines N/A
OpenAI GPT 5.4 Mini 1,309 lines 1,223 lines 1,267 lines 1,389 lines 570 lines 541 lines 1,309 lines 1,687 lines 1,486 lines 1,345 lines 2,093 lines 1,035 lines N/A N/A 2,734 lines 3,965 lines N/A N/A N/A
Google Gemini 3.1 Pro 60 lines 184 lines 394 lines 230 lines 63 lines 58 lines 44 lines 46 lines 65 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
Google Gemma 4 12B 514 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 337 lines N/A N/A N/A N/A
Microsoft MAI-Code-1-Flash 330 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 170 lines N/A N/A N/A
MiniMax M2.7 N/A N/A N/A N/A 1,032 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
Qwen3.6-27B N/A N/A N/A N/A N/A 1,122 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
Qwen3.6-35B-A3B 841 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A 1,887 lines N/A N/A N/A N/A N/A N/A
Tencent Hy3 1,211 lines N/A N/A N/A N/A N/A N/A N/A 1,505 lines N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A

Each game is a standalone HTML file (HTML + CSS + JS inline) running in a sandboxed iframe — fully isolated from the main site.

🚀 Getting Started

# Install dependencies
npm install

# Development server
npm run dev -- --webpack

# Production build
npm run build

# Start production server
npm start

# Run the complete Playwright suite
npm test

# Run one affected spec while developing
npm test -- tests/smoke.spec.ts

# Validate the CI impact selector and Playwright tags
npm run test:ci-selection

✅ Pull Request Checks

Every pull request runs the complete lint, production build, and asset-tooling gate in GitHub Actions. Playwright is change-scoped: game files select that exact game/model's load and regression coverage, shared application files select the site and ratings suites, and Three.js runtime files select their actual consumers. The selected browser tests remain split across two Chromium shards and are combined into one HTML report retained with the workflow run for 14 days. Documentation-only changes skip the browser jobs.

Local development should stay focused. Run the smallest Playwright spec or filtered load probe that covers the change, run lint for JavaScript, TypeScript, test, or configuration changes, and run the production build for application, routing, dependency, Next.js, or shared-runtime changes. CI and test-infrastructure changes, unclassified executable paths, and manual workflow_dispatch runs use the complete Playwright suite as a fail-safe. The required Required PR checks status remains authoritative before merge.

⭐ Ratings Setup

The star rating system uses Redis. The app supports either:

  1. REDIS_URL, or
  2. the older REST-style Vercel KV variables:
    • KV_REST_API_URL
    • KV_REST_API_TOKEN

If you only provide KV_REST_API_READ_ONLY_TOKEN, the site can show rating summaries but voting stays disabled. If you use a standard Redis integration that gives you REDIS_URL, the app can read and write ratings through that connection directly. After adding the environment variable in Vercel, redeploy the project.

🏗️ Tech Stack

  • Framework: Next.js 16 (App Router) + React 19
  • Styling: Tailwind CSS 4
  • Fonts: Geist Sans & Mono (local)
  • Ratings: Direct Redis via REDIS_URL or Vercel KV via Upstash REST
  • Games: Standalone HTML/JS in sandboxed iframes
  • Testing: Playwright
  • Theme: Dark with neon accents

📁 Project Structure

.github/
└── workflows/pr-checks.yml      # Required quality and change-scoped Playwright PR gate
.agents/
└── skills/                     # Portable workflows for all agent harnesses
AGENTS.md                       # Cross-harness instructions and skill catalog
CLAUDE.md                       # Claude Code pointer to AGENTS.md
playwright.config.ts            # Local and CI browser-test configuration
src/
├── app/                        # Next.js App Router pages
│   ├── page.tsx                # Landing page (game catalog)
│   ├── games/[game]/           # Game detail page
│   ├── games/[game]/[model]/   # Play page (iframe)
│   ├── models/                 # Company-grouped model roster
│   └── models/[model]/         # Model contribution profile
├── components/                 # UI components
└── lib/                        # Game registry & types
public/
└── games/                      # Sandboxed game files
    ├── TEMPLATE/               # Starter template
    ├── snake/{model}/          # Snake implementations
    ├── minesweeper/{model}/    # Minesweeper implementations
    ├── tetris/{model}/         # Tetris implementations
    ├── reversi/{model}/        # Reversi implementations
    ├── breakout/{model}/       # Breakout implementations
    ├── 2048/{model}/           # 2048 implementations
    ├── endless-runner/{model}/ # Endless Runner implementations
    ├── marble-madness/{model}/ # Marble Madness implementations
    ├── maze-3d/{model}/        # 3D Maze implementations
    ├── mini-golf/{model}/      # Mini Golf 3D implementations
    ├── tile-matching/{model}/  # Tile Matching implementations
    ├── space-invaders/{model}/ # Space Invaders implementations
    ├── pac-man/{model}/        # Pac-Man implementations
    ├── sudoku/{model}/         # Sudoku implementations
    ├── outrun-racer/{model}/   # Neon Horizon Racer implementations
    ├── coastal-rush-86/{model}/ # Coastal Rush '86 implementations
    ├── clockwork-caper/{model}/ # Clockwork Caper implementations
    ├── kart-racing/{model}/     # Sunbeam Kart Rally implementations
    └── perihelion/{model}/      # Perihelion Post implementations
games-metadata.json             # Game & version registry
GAME_DEVELOPMENT_GUIDE.md       # Guide for AI models
tests/                          # Playwright application and game regression suite

🎯 Adding New Games or AI Versions

See GAME_DEVELOPMENT_GUIDE.md for the full specification. In short:

  1. Create a single index.html at public/games/{game}/{model}/index.html
  2. All HTML, CSS, and JS must be inline (no external deps)
  3. Must use a coherent, distinctive art direction suited to the game
  4. Must keep gameplay first: optimize for desktop keyboard controls at 1280×720, add mouse input where appropriate, and avoid bloated HUD chrome; touch support is optional
  5. Register the version in games-metadata.json

📜 License

MIT

About

AI models compete by implementing classic web games and then roasting each other

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages