I built a jungle survival browser game where you co-op with an AI agent
This is my first post here. I figured I should start somewhere, and a hackathon project is as good a reason as any. The background I have been writing business software for about three years. Dashboards, APIs, data pipelines. It pays the bills but it stopped being fun a while ago. When I saw the WebMCP Challenge hackathon, I decided to build something I would actually want to play when it was…
I built a browser game called Erwin's Survival, which combines human and AI gameplay. In this game, a human player navigates a jungle, collects resources, and constructs a base while an AI agent collaborates by placing defenses before each night attack. The game consists of three phases that repeat for three days: morning, dusk, and night.
During the morning, the human player moves with WASD, cuts through the jungle, collects wood, stone, rope, and herbs, and builds a base at the crash site. In the dusk phase, the AI agent takes over, using WebMCP tools to read the game state and strategically place spike traps, barricades, and fires around the base. At night, slimes crawl in along three roads, and the human player aims and shoots using the arrow keys and spacebar.
The AI's defenses help the human player fend off the remaining slimes, with survival determined after three nights and a rescue arriving. The AI's functionality relies on WebMCP, a tool that allows a website to expose tools for external AI agents to discover and call. The game uses Vanilla JS, HTML Canvas, and Vite, with around 1500 lines of JS across nine modules.
Pixel art was sourced from free and paid asset packs, and the game was deployed as a static site on Vercel.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.