---
title: "Battleground"
url: "https://aigamehub.app/zh-tw/games/battleground-a518fa"
source: "https://github.com/VikasVerma25/BattleGround"
source_type: "github"
play_url: "https://battleground-fun.vercel.app/"
platform: "unknown"
login_required: false
pricing: "free"
origin: "original"
ai_tools: ["Gemini", "Claude"]
game_languages: ["en"]
author: "VikasVerma25"
author_handle: "VikasVerma25"
category: "動作"
categories: ["action", "casual", "text-ai"]
tags: ["ai-judge", "arcade-style", "browser-game", "llm", "vanilla-js", "versus-battle"]
added: "2026-11-12T12:38:25.464Z"
updated: "2026-11-12T12:38:25.464Z"
locale: "zh-tw"
content_locale: "zh-tw"
---

# Battleground

輸入任意兩名鬥士——動物、物件、人物或虛構角色——AI 裁判會選出贏家，並以幾句趣味句子解釋判決，整體包裝成街機格鬥遊戲。

## Description

一款小型瀏覽器遊戲，帶有街機格鬥遊戲的外殼：兩個角色欄位、一個 VS 畫面、一個 FIGHT! 按鈕、一個附有血條的競技場、一段 K.O. 動畫，以及一段逐字打出的判決。玩家輸入兩名鬥士（各 1–50 個字元，不能相同）；前端會將兩個名字送到無伺服器端點，該端點會詢問 LLM（Gemini 或 Claude）選出贏家並給出簡短理由，然後將答案對應回所選的名字。已完成的對戰可以儲存到保存在瀏覽器 localStorage 中的 BattleDex。以純 HTML、CSS 和 vanilla JavaScript 加上一個 Vercel 無伺服器函式打造；儲存庫包含每個畫面的截圖。

## Original post

Type any two fighters and an AI judge decides who'd win. Arcade-style web app built with vanilla JS and a Vercel serverless function (Gemini or Claude).

Topics: ai, arcade, claude, game, gemini, llm, serverless, vanilla-js, vercel

<div align="center"> # ⚔️ BATTLEGROUND ### Type two fighters. An AI judge tells you who would win. *A T-Rex vs 10 cows? 10 cats vs 100 frogs? A pebble vs a tank? Settle it in an arcade-style arena.* ![HTML5](https://img.shields.io/badge/HTML5-vanilla-e34f26?style=flat-square&logo=html5&logoColor=white) ![CSS3](https://img.shields.io/badge/CSS3-no%20images-1572b6?style=flat-square&logo=css3&logoColor=white) ![JavaScript](https://img.shields.io/badge/JavaScript-no%20framework-f7df1e?style=flat-square&logo=javascript&logoColor=black) ![Vercel](https://img.shields.io/badge/Vercel-serverless-000000?style=flat-square&logo=vercel&logoColor=white) ![Gemini](https://img.shields.io/badge/LLM-Gemini%20%7C%20Claude-8e75ff?style=flat-square) **[🎮 Live demo](https://battleground-fun.vercel.app/)** <img src="snapshots/1-input.png" alt="Battleground character-select screen with two fighters entered" width="860"> </div> --- ## ✨ What it is Battleground is a tiny web game. You type **any two fighters** (animals, people, groups, objects, fictional characters, anything) and a "Battleground Judge" LLM picks a winner and explains the ruling in a few playful sentences. The whole thing is dressed up like a classic arcade fighting game: character select, a crowd-filled arena with health bars, a K.O. screen, and a **BattleDex** that remembers your past fights. It is deliberately small: plain HTML, CSS and vanilla JavaScript on the front, and **one** serverless function on the back. ## 📸 Tour | | | |---|---| | **1. Character select** | **2. The fight (loading)** | | <img src="snapshots/1-input.png" alt="Input screen"> | <img src="snapshots/2-loading.png" alt="Loading arena with crowd posters and health bars"> | | Two slots, a big **VS**, and the **FIGHT!** button. | Names clash in a looping animation while the AI thinks. The crowd holds 2-3 random signs every fight. | | **3. K.O.!** | **4. The verdict** | | <img src="snapshots/3-ko.png" alt="K.O. slam screen"> | <img src="snapshots/4-result.png" alt="Result screen with winner and judge's ruling"> | | The loser's health bar drains to empty. | The winner pops in; the judge's ruling is typed out (with a Skip button). | <div align="center"> **5. The BattleDex** (saved fights, stored in your browser) <img src="snapshots/5-battledex.png" alt="BattleDex with one saved fight" width="860"> </div> ## 🧠 How it works ```mermaid sequenceDiagram participant U as Player participant B as Browser (app.js) participant F as /api/verdict (Vercel function) participant L as LLM (Gemini or Claude) U->>B: types two fighters, clicks FIGHT! B->>B: validate (trim, 1-50 chars, not identical) B->>F: POST { fighterA, fighterB } F->>F: sanitize + validate again F->>L: system prompt + names as JSON data L-->>F: { analysis, winner: "A" | "B", reasoning } F->>F: map "A"/"B" back to the real name, drop "analysis" F-->>B: { fighterA, fighterB, winner, reasoning } B->>U: K.O. screen + typed ruling U->>B: Save to BattleDex (localStorage) ``` ### The judge T
