Winter 2026 · Sent from Tranquility Base
Visit the moon studio ↗
Game development

I Made a Browser Game with AI in 2 Days: A Claude Code Tutorial

I made a dark fantasy survivor-like browser game in 2 days with Claude Code. I cover MIT projects, art for commercial use and image prompts.

An astronaut sits at a desk in the lunar base while a small robot hands him a toy sword; on the desk are a laptop and a dungeon diorama where a knight swings his sword at a skeleton
An astronaut sits at a desk in the lunar base while a small robot hands him a toy sword; on the desk are a laptop and a dungeon diorama where a knight swings his sword at a skeleton

Endless Curse is a dark fantasy survivor-like browser game I made with Claude Code. It plays like Vampire Survivors: your skills fire on their own, and all you do is move, pick a card when you level up, and survive wave after wave of monsters. It runs in the browser on desktop and mobile, with nothing to download.

It took me 2 days to go from nothing to a playable build. I’ll walk you through how I built a browser game like Vampire Survivors with Claude Code, from finding a project to build on and sourcing the art to writing image prompts and giving Claude Code instructions at each step.

Endless Curse home page: a dark forest background, a gold title, and Play Now and Beginner's Guide buttons below
The home page. Free, no download, available in 11 languages including English.

What I made in 2 days

Area

First version

Art

Characters, monsters, maps and UI all come from the open-source game Flare; the missing bosses and skill effects were drawn with AI

Graphics

Angled 3D view with a 2D fallback when WebGL isn't available

Stages

5 stages, each with its own map and weather; the final boss appears 15 minutes in

Difficulty

Normal, Nightmare, Hell

Classes

7 classes, each playable as male or female; 12 skills and 3 paths per class

Bosses

5 unique bosses, each with its own animations

Gear

6 slots with random affixes; the hero's look changes with the gear

Languages

11

Claude Code wrote most of the code.

My job was to judge whether the skill effects looked flashy enough. AI has a poor eye for that, and it's where I spent most of my time.

How can you make a game with AI in just 2 days?

You might think 2 days in the title is an exaggeration. Developers who already work closely with AI won't, though, because they can do it too.

If you ask AI to build a game from scratch, whether with Claude Code or Codex, there are only two ways to get a playable build that scores around 70 out of 100 in one go:

  • Build on an existing open-source project: movement, monster spawning, level-up cards and saving are already there, so the AI can focus on swapping the art and adding new systems. That's what I did here: I got the game running using an MIT-licensed open-source project first, then reshaped it step by step into what I wanted.
  • Use a Loop Engineering workflow: spell out the gameplay, logic and effects you want in detail, then have one agent act as the commander, sending subagents off to work, discuss and score, round after round. The whole process burns a lot of tokens, the result may end up about the same, and just defining the task goals up front takes a good amount of time.

Step 1: Find an MIT-licensed survivors game project

It doesn’t matter which game engine these projects use. A browser game has to be light enough to load quickly, and writing your own engine is a good way to get there, so I usually have the agent write a lightweight game engine itself. What you actually need is the survivors gameplay logic and collision algorithms: how monsters spawn and chase the player, and how bullets and area skills decide whether they hit.

Search GitHub for "survivor" and filter by the MIT license, and you'll find plenty. Here are a few I picked:

Project

Original tech

What's worth borrowing

matthiasbroske/VampireSurvivorsClone

Unity

20+ upgradable weapons, 4 monster types and 2 bosses; monsters, bullets and damage numbers are reused through object pools; spawn timing and ratios are set with keyframes

bones-ai/c-blob-survival

C, raylib

Quadtree collision detection that stays smooth with thousands of monsters on screen; the whole game is in one file, easy to read

DarkRewar/SurvivorsStarterKit

Godot 4 (C#)

A starter kit: character movement, 4 spells, monster and boss spawning, growth curves and leveling, with a simple architecture

pedrobarretto/pokemon-survivors

TypeScript, Canvas 2D

A browser game with no game engine, using a spatial hash for collision; it has 15-minute monster waves, bosses, evolutions and mobile touch controls

The first three aren't browser games, but that's fine: have the agent understand their gameplay logic and collision algorithms, then rewrite them for the web. The last one, pokemon-survivors, doesn't have as many stars, but it's exactly the approach I described: a browser game with no engine and its own lightweight code.

Once you've found a project, download it into a ./ref folder inside your game project. If you use Git for version control, add the reference folder to .gitignore first so someone else's code doesn't get committed with your project:

git clone --depth 1 https://github.com/pedrobarretto/pokemon-survivors.git ref
echo "ref/" >> .gitignore

Here’s the kind of prompt I’d give Claude Code. Adjust it to suit your game.

Use the gameplay logic and collision algorithms of the survivors game in ./ref/
as a reference, and write a browser version in vanilla JavaScript and Canvas 2D:
the player moves with WASD, skills cast automatically, monsters spawn in waves
from off-screen, and picking up XP gems to level up offers a choice of three.
Don't use a game engine, and keep the code lightweight.

Careful: MIT code doesn't mean you can use the art

The MIT license covers the code. Whether you can use the characters, images and music in the project is a separate question. Take pokemon-survivors, which went viral on social media a while back: its character sprites all come from another open-source project, PMD SpriteCollab, licensed under CC BY-NC 4.0, which doesn't allow commercial use. The author also states in the README that the MIT license only covers the source code and the game as a whole can't be used commercially. On top of that, the Pokémon characters are Nintendo trademarks.

There are plenty of cases like this. If you want to make a MapleStory survivors game, a Ragnarok Online one, a Diablo II one or a Stone Age one, you can find the art files in the original game's install folder. GitHub also has projects like roBrowser, a browser version of Ragnarok Online, and OpenDiablo2 for Diablo II, which run once you plug in the original game's art. But having the files doesn't mean you're allowed to use them: the characters, maps and music are still copyrighted by the original publisher. Unless you're fine with a takedown notice, keep it as a project for your own fun; try to make money from it and sooner or later the publisher's lawyers will come knocking.

That’s why I chose Flare for the art. Its license allows commercial use.

Step 2: Get art you can use commercially

When you make a game alone, art usually takes the most time. Nearly all the characters, monsters, maps and UI in this game come from Flare, an open-source action RPG. Its art is licensed under CC-BY-SA 3.0, so commercial use is allowed, but you have to give credit, and modified images must use the same license.

Flare's images can't be used as they are, so I had Claude Code write a few conversion scripts:

  • Isometric to top-down: Flare uses diamond-shaped isometric tiles, and the script straightens them into square top-down tiles.
  • Layered characters: Flare's heroes are drawn with the head, body, legs, weapon and shield as separate parts, and the script stacks them into one animation sheet with 8 directions.
  • Paper-doll gear: the same parts are reused for equipment, so when the Knight goes from a short sword to a greatsword, or from leather armor to plate, the hero on screen changes too.

Example prompt:

Download the hero and monster images from flareteam/flare-game and write a
Python conversion script: stack the separate head, body, legs and weapon into
one image, and output an animation sheet with one direction per row
(8 directions) and one frame per column, anchored at the feet.

Remember to include asset credits and license information in the game.

Step 3: Generate game assets with AI (prompts included)

Whatever Flare didn't have, I filled in with AI:

  • 5 bosses: drawn with gpt-image, then sliced by a script into walk, attack, cast and death animations.
  • Skill effects: when I redid the skills on day two, I drew 40+ more effect images with gpt-image.
  • Plague Lich: this one is a 3D model made in Blender, then rendered out as images for the game.

I installed the Codex plugin in Claude Code, so any image-related prompt gets handed to Codex automatically and drawn with gpt-image, with no switching between tools. Each request comes with a Flare image as a style reference. The prompts look roughly like this (excerpts):

Boss sprite (The Cow King as an example):

Create ONE new game sprite.
- Subject: 'The Cow King', a huge hulking bipedal cow-man, black-and-white
  spotted hide, massive curved horns, a battered golden crown, a tattered
  royal red cape, a giant ornate halberd, glowing red eyes.
- Style: match the attached reference image exactly (a sprite from the
  open-source game Flare: pre-rendered 3D look, muted realistic colors,
  soft lighting from the upper left), NOT cartoon, NOT pixel art.
- Camera: high three-quarter isometric view, facing the bottom-right.
- Background: fully transparent.

Boss walk animation (using the image above as the character reference):

Create a SPRITE SHEET showing a walk cycle with a WIDE STRIDE where BOTH
LEGS ARE CLEARLY VISIBLE in every frame. EXACTLY 6 frames in a single
horizontal row, feet on the same baseline, of EXACTLY this same character:
same outfit, same colors, same proportions, same lighting.

Skill effect (a fire hydra as an example):

Dark fantasy action-RPG spell effect sprite, hand-painted painterly realism
matching Diablo II and the open-source Flare RPG assets. Big, bold, simple
shapes that still read clearly when shrunk to 32 pixels. No characters,
no text. Rendered on a flat pure magenta background (#FF00FF).
Subject: a three-headed fire hydra rising out of a pool of cracked molten
rock, dark charcoal-black scales with glowing molten-orange cracks.

Claude Code designed all these prompts on its own when asking Codex for images. I wasn't involved at all. It even thought of details like these: attaching a Flare image as a style reference so the results don't come out too cartoonish; stressing that both legs must be visible in every frame of the walk cycle, since AI often hides one leg behind the other; and putting effects on a pure magenta background so a script can remove it more easily later.

Agents this capable take a lot of work off your plate. Seen from another angle, though, it also means a lot of game artists will lose their jobs.

I kept most of the AI art after the first round. It looked good.

Designing the Plague Lich

For the Plague Lich boss, I started with concept art, turned it into a 3D model, rendered images from 8 directions, and finally put it in the game.

Plague Lich concept art: a crowned skeleton mage in a tattered green robe, holding a skull staff that gives off green smoke
Step one: concept art.
The Plague Lich 3D model, rendered from 8 directions
Step two: build the 3D model and render 8 directions.
Gameplay: the Plague Lich stands in the Shady Forest with the boss health bar above, and the hero nearby
Step three: put it in the game.

If you also want to turn AI-drawn characters into 3D models, the fastest way is Tripo: upload one image and it generates a textured 3D model. Sign up with my invite code ZJP1V3 to get 500 free credits. The redemption steps are in How to Redeem a Tripo Invite Code, and Tripo is compared with Blender scripts in AI 3D Modeling Hands-On.

Step 4: Add a 3D view (optional)

The game logic is still 2D; only the rendering switches to a Three.js 3D angled view. The ground is a textured plane, characters and monsters are billboards that always face the camera, and lights, particles and bloom are added on top.

In the 3D view, a mage casts purple lightning at a crowd of monsters, with a red health orb and a skill bar at the bottom of the screen
A lightning skill. The health orb and skill bar at the bottom are modeled on Diablo IV.

Example prompt:

Keep the 2D game logic and only switch the rendering to a Three.js 3D angled view:
a textured plane for the ground, and camera-facing billboards for characters
and monsters. Fall back to 2D automatically on devices without WebGL.

At first, the 3D view ran at only 17 frames per second on Intel integrated graphics. After switching to drawing the ground and lighting directly with WebGL, it reached 60. Once you're done, always test on a computer without a dedicated GPU and on a phone.

Step 5: Design the stages

Each stage has its own map, monsters and boss:

  • Shady Forest: fog.
  • Deep Cavern: very dark; you can only see the area around the hero.
  • Frozen Plains: blizzards and frozen lakes.
  • Forgotten Ruins: narrow corridors.
  • Burning Crypt: rivers of lava.

Survive until minute 15 and the final boss appears. Beat it to clear the stage, then either take your rewards and leave or keep playing in endless mode. The difficulty settings are Normal, Nightmare and Hell.

Story: handing it to an AI team with Loop Engineering

For the prologue and the story of the 5 stages, I used the Loop Engineering workflow I mentioned earlier:

  • Editor-in-chief: Opus, in charge of directing.
  • Writer: Fable, writing the script.
  • Reviewers: Opus, Sonnet and Codex, scoring the script.

The reviewers had to give the script 9.5/10 before it was final. Then they built the script into the game and tested it themselves. They finished writing the script and testing the stages in 2 hours. I didn’t have to step in. I didn't count the tokens, but one Claude Ultra plan was enough.

Step 6: Design the skills, then build a skill showcase page

The first version had 13 common action RPG skills and only 3 classes: Knight, Sorcerer and Hunter. On day two I redid all of it:

  • Added 4 classes (Paladin, Necromancer, Assassin and Barbarian), each playable as male or female.
  • Gave each class 12 skills of its own, split into 3 paths.
  • Talent trees follow the skill paths, and points can be reset.
  • The bottom of the screen became a Diablo IV-style skill bar: two orbs on the left and right for health and Fury, with a basic attack and 4 skills in the middle.
  • Fury builds up from hitting monsters, getting hit and killing; once it's full, you can unleash each class's own ultimate.

With that many skills, testing them one run at a time was too slow. I built a separate page where I could test any skill without waiting for waves of monsters. I could adjust the skill level and the number of training dummies to check the effects and damage.

The full skill showcase page: the game view on the left with a meteor exploding, and the skill list panel on the right
The whole skill showcase page. The panel on the right lets you pick skills and adjust their level and the number of dummies.

I use the same page to tune monster attacks. Switch to "Monster attacks" and you can summon a monster in front of the hero and just watch its moves, without the hero taking damage. Take the Frost Lord: up close it uses a heavy strike and Frost Nova, and at range it throws a Frozen Orb and fires a beam. Whether a move's range, speed and effects are right is obvious at a glance here.

The skill showcase page in monster attack mode: the Frost Lord attacks the hero with a frost ring under its feet, and the right panel lists the monsters you can summon
Monster attack mode: the Frost Lord mid-attack.

Example prompt for the skill showcase page:

Build a skill showcase page (only opens when ?demo is added to the URL): no monster waves,
a right-side panel to pick a skill and cast it directly, and to adjust skill level
and the number of training dummies. Dummies can be set to not move and not die.
Also add a "Monster attacks" mode: summon a chosen monster in front of the hero
and just watch its moves, without the hero taking damage.

Step 7: Website pages, starting with home page mockups

The game also needed a home page, a beginner's guide and a legal notice. I first had Codex make home page mockups, several backgrounds at once for me to choose from, back when the game was still called 暗黑倖存者 (Dark Survivor). Once I'd decided, I had Codex generate the final home page background and applied it; for the other pages, Claude Code generated them on its own in the style of the home page.

6 home page mockups with different backgrounds: a knight facing a horde of corpses, a crypt throne, silhouettes of seven heroes, a village at night, a forest graveyard and a snowy camp, all titled 暗黑倖存者
Home page mockups from Codex, back when the game was called 暗黑倖存者 (Dark Survivor).

Step 8: Switch to a stronger model to check architecture, security and performance

Once the features are in place, give the code one last review before launch.

  1. Type /model in Claude Code, switch the model to Fable, and set effort to high or above.
  2. Have it scan the whole codebase for gaps and security vulnerabilities, and do a performance review.
  3. Work through the issues it finds, one by one.

Example prompt:

Scan the whole project's code architecture and find anything left unhandled,
such as error handling, memory that isn't released, save format compatibility
and mobile touch controls.
Check for security vulnerabilities, such as tampered saves or scores, account
login, and unfiltered text typed in by players.
Then do a performance review: on computers without a dedicated GPU and on
low-end phones, what costs the most performance and how can it be improved?
List the issues sorted by severity, and fix them one by one after I confirm.

Step 9: Launch first, add features once people play

I launched the game after 2 days, as soon as it was playable. There are tons of browser games out there and players' attention is spread thin, so getting people to play is actually hard. Don't dream of going viral on day one, then bury yourself building features only to find out after launch that you're the only one playing. Get people playing first, and add features once it catches on.

What I learned making a game with Claude Code

Making a game is easy now. Coming up with something original is the hard part. This post is a tutorial demo, and I hope it helps.

Can Claude Code make games?

Yes. Claude Code wrote most of the code for Endless Curse, and it took 2 days to get to a playable build.

Do you have to write a game from scratch to make it with AI?

I wouldn't. If you want a playable build fast, the easiest route is building on an existing open-source project, for example one you find by searching GitHub for survivor and filtering by the MIT license, and borrowing its gameplay logic and collision algorithms. Starting from scratch means spelling out the gameplay in detail and having several agents split the work and score it, which burns a lot of tokens.

How do you make a game with AI?

Find an MIT-licensed project to get the game running, get art you can use commercially and fill the gaps with AI, then build the stages, skills and website pages, and before launch switch to a stronger model to check the architecture, security and performance. The 9 steps in this post are exactly how I made Endless Curse.

Where can I find free game assets?

Open-source games are a good source, but always check the license. The art of the open-source action RPG Flare is CC-BY-SA 3.0, which allows commercial use with credit; PMD SpriteCollab, used by pokemon-survivors, is CC BY-NC 4.0 and doesn't allow commercial use.

Where does the art come from when you make a game with AI?

This game's characters, monsters, maps and UI come from the open-source game Flare (licensed CC-BY-SA 3.0), and the missing bosses and skill effects were drawn with gpt-image.

Is Endless Curse free?

Yes. It runs in the browser on desktop and mobile, with nothing to download.

Are there browser games like Vampire Survivors?

Yes. In Endless Curse, skills fire automatically as they do in Vampire Survivors. The gear, talents and final bosses fit the dark fantasy setting.

Is Endless Curse available in English?

Yes. It comes in 11 languages, including English.

If you've played Endless Curse and have thoughts, tell me on Threads or X.