Soga123Field notes on AI game generators
Last count 15 Nov 2026
中文
03Choosing a generator · 8 min read

Can You Edit the Code It Gives You?

Three questions hide inside that one: can you read the file, can you change it in the tool, and do your edits survive the next generation.

Published 1,916 words By

Short answer: usually yes, you can get the code out and change it by hand. Usually no, you cannot change it inside the tool unless you are on a paid plan — and even then, the next prompt may overwrite what you changed. Those are three separate questions, and almost every article on the subject answers one of them while implying all three.

This article is built from a single build we generated and then read line by line: 388 lines of JavaScript, 11,201 bytes, plus six asset files. Where we did not do something, we say so in plain words rather than implying it.

The one question that is really three

When someone types "can you edit AI generated game code", they are usually asking one of three things without knowing which:

  1. Can I read the code? Does the file exist somewhere I can actually open?
  2. Can I change it inside the tool? Is there an editor, and is it behind a paywall?
  3. Do my changes survive? If I hand-edit the file, does the next request keep my work or replace it?
ONE SEARCH, THREE DIFFERENT QUESTIONS Can I read it? Does the file exist somewhere I can open? USUALLY YES Can I change it in the tool? Is there an editor, and is it unlocked? OFTEN GATED Do my edits survive? Does the next request keep or overwrite them? OFTEN NO Answers above are what we found on one build, one free account — not a survey of the market. The vendor's own wording for question two, on 19 February 2026: expose the code first, then allow editing it. That is a roadmap, not a feature list.
One search, three questions: read the file, change it in the tool, and keep the change through the next generation.

The answers do not have to agree, and on the build we made they did not. Reading was free. In-tool editing was locked. Survival was never on the table, because there was no second generation to merge into.

What one build actually hands over

Our prompt, unchanged: "A 2D platformer where a cat jumps between rooftops, collects fish, and avoids dogs. Three levels with increasing difficulty, a score counter, and a win screen after level three."

The output was a playable game and a file listing that we measured rather than estimated:

ItemMeasured value
main.js388 lines, 11,201 bytes
Top-level functions16
Top-level bindings (const / let)25
Imports / exports / require0 / 0 / 0
Network calls in main.js0
Asset files referenced6 (4 images, 2 audio)
Level definitionsone LEVELS array, 3 entries, lines 59–63
ONE FILE, MEASURED · main.js 388 LINES 11,201 BYTES 16 FUNCTIONS 25 TOP-LEVEL BINDINGS 0 IMPORTS · 0 EXPORTS · 0 fetch CALLS · 0 localStorage GAME STATE LIVES AT MODULE LEVEL — nine keys written and read in place: state · levelIndex · score · lives · roofs · fishes · dogs · camX LEVEL DATA · LEVELS[3] · LINES 59–63 ASSETS · 4 IMAGES + 2 AUDIO Everything the game needs to run is in this one script and six files next to it.
What the file contains: one flat script, 16 functions, 25 top-level bindings, no imports, six assets.

That shape is the single most useful fact in this article. It is not a framework project with a build step and a dependency tree. It is one flat script with everything in it, which is exactly why it is easy to port and surprisingly annoying to modify.

The editor said no. The file said yes.

Inside the tool, the code panel did not open for us. Clicking the CODE tab on a free account produced one line: "To access the project code, upgrade your plan." That is the entire in-tool answer to question two — not "you cannot edit code", but "you cannot see it here".

The file itself was a different story. The published build serves its own script from the same directory as its index.html, so the complete 388-line main.js was retrievable with a plain request. We read all of it, and every measurement in the table above comes from that copy.

Two things to keep straight about that, because both get abused in articles like this one:

  • The published artifact is not the project. You get the output, not the source of truth the tool edits. There is no link back to the model that produced it, no history, no undo.
  • Whether that is permitted is a terms question, not a technical one. It varies by tool and it can change. The general shape of these contracts — who owns the output, what you may do with it — is covered in our plain-language walk through the terms of three tools. Read your own tool's terms before you rely on a workaround that happens to work today.

The vendor says editing is step two

If you want evidence that in-tool editing is a product decision rather than a technical limit, take it from a tool founder. On 19 February 2026, in a public comment, he described his own roadmap: "For education purposes, I think our first step will be exposing the code that the AI is generating and then next allowing editing it."

Read that carefully. Exposing the code was described as the first step, and editing as the next one — from the person building the product. In the same comment he listed the then-current pricing (20 free creations, then $5 for 10 more, or $6 a month for unlimited) and noted that remixing an existing game does not consume credits.

Treat this as a snapshot, not a specification: comments age, roadmaps slip, and the tool may have shipped both steps by the time you read this. The durable point is structural — the industry treats "you can see the code" and "you can change the code" as two features, shipped in that order. When a marketing page says "full code access," ask which of the two it means.

What the file tells you about editing

Open a generated game and you can predict how hard an edit will be before you try it. Our build shows the mechanism clearly.

main.js keeps its entire game state at module level. Not in one tidy object — in 25 separate bindings sitting next to each other:

let state = 'title';
let levelIndex = 0;
let score = 0;
let lives = 3;
let roofs = [];
let fishes = [];
let dogs = [];
let camX = 0;

Level data is a single array, three entries, each defining roof count, the distance between roofs, dog chance and dog speed. Everything else is either a drawing function or update(dt), one function that advances the whole simulation.

Now add the detail that decides how expensive your edit is. The level total is stated twice. LEVELS holds the real count, and line 349 prints the HUD as:

text(`Level ${levelIndex + 1}/3`, W / 2, 70, 54, '#9cf');

A hardcoded 3. Today both agree. Add a fourth level and the loop picks it up while the HUD keeps printing /3, and nothing anywhere warns you. This is not a bug in the usual sense; it is what flat, generated code does — it states facts where they are needed instead of where they belong.

There is a second detail of the same kind. buildLevel(0) is called once at module scope, so the game builds a level before you press start, and then startGame() resets levelIndex, score and lives and calls buildLevel(0) again. Two entry points into the same function. Any state you add must be initialised in both paths, or it will behave differently on first load than on a restart.

Three edits, ranked by how far they travel

This is the practical version of "can you edit it". The answer is not yes or no; it is a distance.

HOW FAR AN EDIT TRAVELS 1 · a number inside LEVELS dogSpeed 120 → 80 1 LINE 2 · a fourth level LEVELS array + the total printed at line 349 2 PLACES 3 · something that must survive a level change module-level state + two entry points + resets WHOLE FILE Blast radius is measurable before you type: count how many places state the same fact.
Three edits by blast radius: one number is one line; one extra level is two places; a new mechanic is the whole file.
EditWhat it touchesRisk
Change a value inside LEVELS — dog speed 120 → 80one line, line 61low; nothing else reads that number
Add a fourth levelLEVELS plus the hardcoded total at line 349, plus whatever difficulty curve you assumedmedium; the second place is silent
Add something that must survive a level transition — a coin counter, a carried itemmodule-level state, both reset paths, update, drawUIhigh; the file has no single place where "a run" is defined

The third row is where most real feature requests land, and it is why hand-editing generated code feels fine for an afternoon and stale by the end of the week. You are not editing a parameter. You are introducing a concept the original file never had, into a file with no structure to hold it.

Can you take the file somewhere else?

Structurally, yes — with one correction to the usual advice. The coupling to the tool is not in the game code.

main.js makes no vendor calls at all. No imports, no exports, no network requests, no storage, no message passing to a parent frame. It uses a canvas, the Audio constructor and requestAnimationFrame, and it loads six files by relative path.

The vendor lives in index.html, and it is busy: a scripts loader, a chat manager, a progress logger, an OG-preview script, a defaults stylesheet and script, an empty import map, and a long inline block that reroutes audio so the parent page can control volume.

WHERE THE VENDOR ACTUALLY LIVES index.html · COUPLED ScriptsLoader-Universal.js ChatManager.js ProgressLogger.js OGP.js rosebud-game-defaults.css / .js + inline audio-routing block, empty import map main.js · PORTABLE canvas · Audio · rAF no vendor calls no network calls no storage calls 6 assets, relative paths THIS IS THE PART YOU EDIT PORT LIST: 1 HTML · 1 JS · 6 ASSETS We have not re-hosted this build anywhere. The list above is what the files contain, not a result we ran.
The vendor coupling is in index.html, not main.js: four remote scripts, a defaults pair, an inline audio bridge.

So the porting list for a build like ours is short and checkable: one HTML file, one JS file, six assets. Three shell commands tell you whether your own build matches that shape:

grep -E "^\s*(import|export|require\()" main.js     # dependencies
grep -nE "fetch\(|XMLHttpRequest|localStorage" main.js   # hidden services
grep -n "<script src=" index.html                     # vendor coupling

What you must not expect is for the tool to keep working on the ported copy. Once it is out, it is yours to maintain: no chat to change the difficulty, no new art, no regenerate. That trade — control for momentum — is the real decision behind "should I edit the code", and it is worth making deliberately rather than discovering halfway through.

Five checks before you believe "you can edit the code"

Run these in five minutes on any generated build, including your first one:

  1. Count the files. One script and a handful of assets is portable. A directory tree with a build step is a commitment.
  2. Count the vendor scripts in the host page. Whatever is in index.html decides whether the game runs outside the tool.
  3. Grep for imports and fetch. Zero of both means the script is self-contained; anything else means you are now maintaining someone's dependency graph.
  4. Find every fact stated twice. HUD totals, lives printed in help text, difficulty numbers repeated in comments — each duplicate is a future mismatch.
  5. Find every entry point into the level builder. If a function is called both at load and on restart, new state has two places to initialise.

If a tool passes all five, "yes, you can edit the code" is a real answer. If it fails two or three, the honest answer is "you can read it, and editing it will cost you more than regenerating it."

What we did not do

We generated one game on one tool with a free account, read its full output, and hit the credit wall on a second attempt. We have not:

  • opened a paid CODE panel, so we cannot tell you what in-tool editing feels like;
  • edited code inside any tool, so nothing here is a report of that experience;
  • re-hosted the build anywhere, so the porting list is a description of the files, not a completed migration;
  • compared a second or third tool. Prices, paywalls and roadmaps differ, and one build is one data point.

Every number above is measured from that single build — line counts, byte count, function and binding counts, the asset list — and every quotation carries its date and a link so you can check it. Where the article reasons rather than reports, it says so: the three-questions split and the blast-radius ranking are a way of reading the file, not a survey of the market.

If you are at the point of deciding whether to edit or regenerate, the loop matters more than the editor. That is covered in the iteration loop — and if you have not generated anything yet, the four-part prompt structure is the cheaper place to spend your first credit.