How to make a game with AI using Claude Code and Ludo.ai
To make a game with AI, split the work in two: a coding agent such as Claude Code writes the game's code, and an asset generator makes the art and audio the game needs. Ludo.ai is the asset half. It generates sprites and animations, images, 3D models, sound effects, music and voices, and its ludo command line tool lets Claude Code generate them and save the files straight into the game's folder. It is not a one-prompt game maker: you still decide what the game is, ask for each piece, approve the assets you keep and playtest. That is how Grave Night, a top-down pixel-art arena game with three nights and a boss, was finished: Claude Code wrote every line of code, every sprite, texture, sound effect, music track and voice line came from Ludo, and the game is free to play on itch.io.
Last updated November 2026
Watch the whole game get made
Claude Code wrote all of Grave Night's code, and Ludo made every picture, animation, sound, music track and voice line. The video follows the build day by day, from the first playtest note to the itch.io release, then shows the bill and how to do it yourself.
We Gave Claude Code 5 Days to Finish Our Game. Here's What It Cost
What you need
- A coding agent that can run terminal commands: this guide uses Claude Code; Cursor, Codex and Gemini CLI can use the same Ludo skill
- A Ludo.ai account on the Pro or Studio plan, the plans that include CLI, MCP and API access (every generation through them costs credits)
- Node.js, to install the Ludo CLI with npm
- A small game idea and the patience to playtest it: the agent writes code, but deciding what is fun is still your job
1Plan a small game and its asset list
Write down what the game is before you generate anything, and keep the first version small. Grave Night started as a 629-line browser game: a pumpkin knight fighting skeletons and zombies in endless waves. The plan to finish it was short: 3 nights of 3 waves, then a boss, a different look for each night, and a victory screen. Turn the plan into an asset list per piece of the game. For each night: a ground texture, eight props and two fence tiles (a horizontal one and a side one). For the boss, the Skeleton King: a character picture, a 3D model, a rig, six moves (idle, walk, slam, summon, hit, death) in 8 directions, his sound effects, his music and a few voice lines. The list is what you generate in step 4 and what you hand to the coding agent in step 5.
2Give Claude Code the Ludo CLI
Install the CLI and log in:
npm install -g @ludoai/cli, thenludo login, which opens Ludo.ai in your browser to authorize the terminal (it works on Pro and Studio). Then runludo skill install, which adds the Ludo skill to Claude Code so it knows the commands and looks up only the ones it needs through--help. Inside the game's folder,ludo initwrites a.ludo.jsonwhere you can set an output folder, a default engine andmax_credits, a spending budget the CLI refuses to go past. Any command takes--dry-runto print its price without running it. If your assistant cannot run commands (Claude Desktop, for example), connect the MCP server instead: the URLhttps://mcp.ludo.ai/mcpwith the headerAuthorization: ApiKey YOUR_API_KEY, using an API key from the web app. The CLI page and the MCP page have the setup for each client.3Fix one art style and one character route
Consistency comes from repeating the same choices, so decide them once. Every Grave Night
ludo image createcall used the same art style, 32-Bit Pixel (--art-style "32-Bit Pixel"), and every night's prop prompt ended with the same clause, "one single object isolated on a plain flat background", so the props cut out cleanly. Characters that must turn in 8 directions take the 3D route: a character picture (ludo model create-image), a 3D model (ludo model create), a rig (ludo model rig), then Directional Sprites (ludo sprite directional), which renders the same rigged model from every direction, so the directions line up. The boss's first concept was made withludo image generate-with-stylefrom a screenshot of the game, so he was in the game's look before he had a model.4Generate in batches, then pick
Ask for several takes and choose.
--n 4makes four variations of an image, andludo batch jobs.jsonruns a whole list of different generations side by side, checking the price of the list first; one failed item does not stop the others, and a failed generation is refunded. Night 1's set, "the pumpkin patch", was three commands: the ground texture (ludo image create --image-type texture --perspective Top-Down --art-style "32-Bit Pixel" --n 4), one batch of the eight props and the fence, and one batch that cut out the eleven picks withludo image remove-backgroundand added the side fence. It cost 27.5 credits and about six minutes. For characters,ludo sprite directional-previewis free: the boss's moves were chosen from free previews of the move presets before any sheet was paid for. Everything of the Skeleton King's that ships in the game, from his concept picture to six moves in 8 directions, his sound effects, his music and three voice lines, came to 92.5 credits. Every file the CLI saves is logged inludo-assets.jsonwith the command, the job id and the cost. In Grave Night's build, a second Claude session ran these commands beside the coding session and handed the picks over in work orders; with the skill installed, Claude Code can run the same commands itself.5Have Claude Code wire the assets into the game
Hand the coding agent the picks with a plain work order: which file is which, what each is for, how big it should look next to the hero, and what must keep working. Ask for a small re-runnable tool rather than one-off edits, and tell it to leave the Ludo originals untouched. In Grave Night, Claude Code wrote
tools/build_level.py, which turns a night's Ludo files into game images (chunky 4-pixel blocks, hard edges, trimmed, sized next to the knight) and manifest entries, so nights 2 and 3 went through the same tool. For the boss it wrotetools/build_king.py, which brought his 48 sprite sheets to one size and ground line and recorded, for each facing, the frame where his sword lands, then the boss logic itself: two phases, a telegraphed slam, summons and a health bar. The loaders, the animation states and the sound mixing are all agent-written code.6Playtest, measure, and fix with proof
Play it yourself or have someone play it, and write the notes down word for word. Grave Night's first playtest note began: "The sound of the sword slash and the other attack does not match what is happening on the screen. The timing is off." Measuring the build frame by frame showed the hit sound fired 6 to 7 frames (100 to 117 ms) before the blade crossed the enemy, and one hit sound clicked because its file started mid-waveform. That measurement went into the work order, and Claude Code moved each impact to the contact frame, faded every sound file in and out from zero (keeping the Ludo originals), added a limiter and wrote tests that check every attack sound against its frame. After the fix the hits landed within 0.2 frames, and on the final build they still do. Ask for a test with every fix, so the next change cannot quietly break it.
7Build for the web and ship it on itch.io
A browser game is the shortest path to something people can play. Ask the agent for a build script: Grave Night's
tools/build_web.pyships only the sprite atlases the game uses and converts the sounds to MP3. A later session split the loading by night, the title first and then only what night 1 needs, so on a simulated phone connection the title screen appeared after 3.6 seconds instead of a 69.9-second wait. On itch.io, choose HTML as the kind of project and upload a ZIP withindex.htmlin it; itch.io's HTML5 guide lists the current limits on file count and size, so check the build against them. itch.io also asks you to tag projects that contain generative AI and to say so in the description. Grave Night is free at ludoaigames.itch.io/grave-night.
Specs
| Who does what | In Grave Night, Claude Code wrote the code (game, tools, tests, web build); Ludo.ai made the sprites, textures, props, 3D models, sound effects, music and voices; people chose the game, playtested it and accepted or vetoed every asset pick |
|---|---|
| Plans with CLI, MCP and API access | Pro and Studio; every generation through the CLI, MCP or API costs credits, on every plan |
| CLI setup | npm install -g @ludoai/cli, ludo login, ludo skill install (Claude Code); npx skills add Ludo-AI/ludo-cli for Cursor, Codex, Gemini CLI and other agents that read skills |
| MCP setup | Server https://mcp.ludo.ai/mcp with the header Authorization: ApiKey YOUR_API_KEY |
| Images and background removal | 0.5 credits per image (4 variations = 2 credits); Remove Background through the CLI or API 0.5 credits per image |
| 3D characters | Character picture 0.5 credits each; 3D model 4 credits (Prop) or 15 (Hero); rigging 1 credit |
| Directional Sprites | 1 credit per direction (one sheet each); previews are free |
| Audio | Sound effect 2 credits; music 3; remix of an existing track (audio transform) 3; voice from a description 2; speech in a voice 2 |
| Grave Night's stack | No engine: plain JavaScript on an HTML5 canvas with Web Audio, built for the browser |
| Grave Night's bill | $134.47 at public prices, for what the assets in the game and the code cost: 477.5 Ludo credits for the 148 assets in the game ($23.88 at the Pro plan's $50 per 1,000 credits) plus $110.59 of Claude Code for the code written in the 19 recorded sessions (22.0 hours, at Anthropic API prices), at the time of writing; the mini game's first code session was not timed and is not on the bill |
| itch.io HTML5 upload | A ZIP with index.html inside; at most 1,000 files, 500 MB extracted, 200 MB per file, at the time of writing |
Tips
- Keep a character's weapon clear of its body in the picture you turn into 3D. The Skeleton King's first pictures held the sword across his legs and were not used; the version that holds it out to the side is the one that was rigged and animated.
- Choose moves with the free Directional Sprites previews before you pay for sheets. A sheet costs 1 credit per direction, so six moves in 8 directions is 48 credits.
- Put a level's whole set in one batch file and run it with
ludo batch. The price of the list is checked before anything runs, and a failed item is refunded without stopping the rest. - Check seamless textures and loops before you hand them over: the free
ludo toolbox image repeatlays a tile out 3x3 and says whether its edges meet, andludo toolbox audio inforeports a sound's loudness, peak and loop seam. Both run offline with no account. - Keep the generated files as they came out and let the agent's tools write processed copies. When a file needs a fix (a click, a halo, the wrong size), you change the tool and re-run it instead of losing the original.
- Set
max_creditsin.ludo.jsonbefore letting an agent generate on its own, and readludo spendandludo-assets.jsonat the end of a session to see what each asset cost.
FAQ
Can AI make a whole game by itself?
Not from one prompt, if you want a finished game. In Grave Night, Claude Code wrote every line of code and Ludo made every sprite, texture, sound effect, music track and voice line, but people chose the game, set its direction, playtested it and accepted or vetoed every pick. Prompt-to-playable tools exist and are compared in the best AI game makers; this guide is the route where you keep the code and the files.
How much does it cost to make a game with AI?
Two bills: the asset generator's credits and the coding agent's usage. What Grave Night's assets and code cost came to $134.47 at public prices: 477.5 Ludo credits for the 148 assets in the game ($23.88 at the Pro plan price) and $110.59 of Claude Code at Anthropic's API prices for the code written in 19 recorded sessions over 22.0 hours (the mini game's first code session was not timed and is not on the bill). Prices per call are in the specs above: a 4-variation image is 2 credits, a Hero 3D model 15, a sprite sheet 1 credit per direction, a sound effect 2 and a music track 3. CLI, MCP and API access needs the Pro or Studio plan, and every generation through them costs credits; pricing has the current plans.
Do I need to know how to code?
You do not have to write the code: no line of Grave Night's code was typed by hand. You do have to say clearly what you want, read what the agent reports, play the result and describe what is wrong. In Grave Night, the work order for the sound fix carried the playtest note word for word, the measurements of which sound was early and by how many frames, and a request for tests that prove the fix.
Which game engine should I use?
Whichever one you and your agent know. Grave Night uses no engine at all: plain JavaScript on an HTML5 canvas, which runs in a browser and uploads to itch.io as a ZIP. If you build in Godot, Unity or Phaser, the CLI can write engine files next to a sprite sheet with --engine godot, --engine unity or --engine texturepacker, and ludo init picks the right one for the project it finds. Importing sprite sheets and importing rigged 3D models cover each engine.
Do I own the assets?
Yes. You own the assets you generate with Ludo and can use them however you like, commercial games included, on every plan. That is why Grave Night's sprites, sounds and music can ship in a public game.
Can I use Cursor or another agent instead of Claude Code?
Yes, though Grave Night itself was built with Claude Code. npx skills add Ludo-AI/ludo-cli installs the same Ludo skill for Cursor, Codex, Gemini CLI, GitHub Copilot and other agents that read skills, ludo init adds a Cursor rule when the project has a .cursor folder, and the MCP server works in any MCP client. See game assets in Cursor.
CLI or MCP: which should I use?
In a coding agent that can run commands, the CLI: it saves files straight into the project, logs what each one cost, and the agent reads only the help for the commands it uses, so it spends far fewer tokens than with MCP, which loads every Ludo tool's schema up front. Use the MCP server in clients that cannot run commands, such as Claude Desktop or claude.ai, with an API key in the Authorization header.
Do I have to say the game uses AI on itch.io?
itch.io asks creators to tag projects that contain material made with generative AI and to state it in the project description, and it strictly enforces this for game asset and soundtrack pages. Grave Night's page carries itch.io's AI disclosure: the pictures, animation, sound effects, music and voice lines were made with Ludo, and all of the code was written by Claude Code. Its description says the same and credits the one part that was not generated, the Silkscreen font.
How long does it take?
Grave Night went from a mini game with no ending to a finished game over five days with a recorded Claude Code session, 22.0 hours of sessions in all. Generating a whole level set took minutes (night 1's ground, props, fences and their cut-outs ran in about six minutes); most of the time went into the agent's coding sessions and their tests.