跪拜 Guibai
← All articles
AI Coding · Game Development · Claude

Zero Handwritten Lines: Claude Code Built This Godot Tower Defense in 5 Days

By ZzT ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The verification loop is what separates this from AI demos that compile but fall apart on device; frame capture and smoke runs are the only way an agent catches runtime crashes and visual regressions. It also maps real Godot constraints for mini-game targets that any developer shipping to WeChat or Douyin will hit: a 20MB total package cap, 4MB main package, no system fonts, and mandatory iOS high-performance mode.

Summary

Claude Code produced every one of Holy Light Defense's 8,408 GDScript lines across 77 files, with 573 test functions, in five days. The developer handled requirements, playtesting, decisions, and account operations like QR logins. The result is a vertical tower defense targeting Steam and WeChat mini-games, packaged at 13.84MB with AI-generated art and code-synthesized audio.

Day one locked two things down. The AI asked four scoping questions before writing: usage, art sourcing, tower defense form, and first-playable size. The answers set copyright rules that banned existing game names from code, data, art, and image prompts, and delivered a fully completable level by the close of day one. On the platform side, the AI found Douyin's official Godot SDK only supports 4.5, WeChat relies on community export templates with nothing official, and mini-game package caps force Godot itself into a subpackage.

The load-bearing infrastructure was a make-based verification toolchain: make test runs 573 unit tests headless; make lint escalates GDScript warnings to errors because Godot's CLI hides warnings by default; make smoke plays a level at 8x speed and fails on any runtime error; make frames captures 91 PNGs per playthrough so the AI visually checks character placement, overflow, and occlusion. When an exported build crashed because a startup optimization cleared an array, the packaging step was amended to auto-play a level from the built binary and check the exit code.

Takeaways
— All 8,408 lines of code in 77 GDScript files, plus 573 test functions, were written by Claude Code with zero hand-typed lines.
— The AI asked four scoping questions before any coding: release purpose, art source, tower defense form, and first-playable scope; the answers set copyright rules and produced a complete playable level by day one end.
— Godot's CLI does not print GDScript warnings by default, so make lint temporarily escalates all warnings to errors to make them visible to the AI.
— Douyin's official Godot SDK only supports Godot 4.5 and no custom export templates; WeChat has no official Godot support, only community templates, one of which tracks 4.7.
— WeChat mini-game package limits are 4MB for the main package and 20MB total; initial research estimated 30MB and a preview rejection revealed the real cap.
— Mini-game environments have no system fonts, so Chinese fonts must be bundled; iOS requires WeChat's high-performance mode.
— make frames auto-plays the first level at 4x speed for 90 seconds, capturing one PNG per game second, and the AI reviews the 91 images for placement, occlusion, and UI issues.
— After a packaging-only crash where a cleared array broke the game on export, the build step now auto-plays a level from the exported binary and checks its exit code.
— Test count grew from 118 on day one to 573 by day five; GDScript has no coverage tooling, so the 80% coverage target cannot be measured and test-first is the only guard.
Conclusions

The four pre-coding questions did more architectural work than the engine choice; they bounded copyright, the art pipeline, and the day-one deliverable, which is why five days of generation stayed on track.

Platform constraints, not code quality, drove the architecture: vertical orientation, font bundling, and subpackage placement for the engine itself all trace back to mini-game platform rules.

Frame capture and smoke runs substitute for human visual testing, and they caught real failures a compile would not: a loading hang on a device, a black iPhone screen, and an array cleared only after export.

Every AI stumble got converted into a permanent regression check, which explains how the test count tripled over five days without a single handwritten line.

Concepts & terms
Vibe coding
A workflow where the developer describes intent in natural language and the AI agent writes all the code, while the human playtests, decides, and handles operations that require a person.
Godot export template
A platform-specific runtime build of Godot used to compile a project for a target like Android, iOS, or a mini-game environment; WeChat has no official template, so community-maintained ones fill the gap.
make smoke
An automated step that launches a game headlessly and plays a level at accelerated speed, failing on any engine or script error; it is the closest an AI can get to actually playing the game.
make frames
An automated visual review step that records one PNG per game second from a headless playthrough so the AI can inspect screenshot sequences for layout, overlap, and positioning mistakes.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗