When you make a game with AI, most of the time it just works. But sometimes you get a blank screen, a game that won't restart properly, or controls that feel wrong — and if you don't code, it's not obvious what to do. The good news is that AI-generated games tend to break in a handful of predictable ways, and each has a reliable fix you can request in plain English. Here's a field guide to the most common ones.

Bugs we'll cover

  • Blank or black screen
  • Game won't restart correctly
  • Controls don't work (or do the wrong thing)
  • No sound
  • Broken on mobile
  • The "it worked, then I asked for a change and it broke" problem

First: open the developer console

Before fixing anything, learn this one trick — it's the single most useful debugging skill for non-coders. Press F12 in your browser (or right-click the page and choose "Inspect"), then click the Console tab. If your game has an error, you'll usually see a red message here. You don't need to understand it — you just need to copy it and paste it to your AI tool. A pasted error message is the fastest way to a fix.

Bug 1: Blank or black screen

You open the game and nothing appears. This is almost always a JavaScript error that stopped the game before it could draw anything. Open the console (F12) and you'll likely see a red error.

The fix: copy the red error text and paste it with a prompt like: "My game shows a blank screen. The browser console shows this error: [paste]. Please fix it and give me the full corrected file." If there's no error in the console, the issue might be that the drawing code runs before the page is ready — ask: "The canvas is blank. Make sure the game only starts after the page and canvas have fully loaded."

Bug 2: The game won't restart correctly

This is the single most common bug in AI-generated games. The game plays fine the first time, but after "Game Over," restarting does something weird — the score doesn't reset, the speed keeps the old value, enemies pile up, or it crashes outright. The cause is that restarting doesn't fully reset the game's state; leftover values and timers from the previous round "leak" into the new one.

The fix: "When I restart after Game Over, the previous game's state leaks into the new one (the score/speed/enemies don't reset properly). Please make restart fully reset ALL game state and clear any running timers or animation loops before starting fresh. Show the full corrected file." Mentioning "clear any running timers or animation loops" is key — duplicate game loops are a frequent culprit.

Prevent it up front: When you first build a game, add this to your prompt: "Make sure restarting fully resets all state and doesn't create duplicate game loops." It saves you from fixing this later.

Bug 3: Controls don't work or do the wrong thing

The left arrow moves you right, the jump button does nothing, or keypresses feel laggy. These are usually simple wiring mistakes.

The fix: describe the exact mismatch: "When I press the left arrow key, the player moves right instead of left, and the up arrow does nothing. Please fix the controls so arrows move in the matching direction and up makes the player jump." If input feels laggy, add: "Movement only happens on each keypress, not while the key is held. Make movement smooth while a key is held down."

Bug 4: No sound

You asked for sound but hear nothing. Ninety percent of the time, this is the browser's autoplay protection: browsers block audio until the player interacts with the page.

The fix: "The game has no sound. I think the audio context is blocked until the user interacts. Please resume/create the audio context on the first click or key press so sound works." If you want to learn more about how game audio works, see our guide on adding sound with the Web Audio API.

Bug 5: Broken on mobile

The game works on your computer but is unplayable on a phone — usually because it only listens for keyboard and mouse, which phones don't have, or because the layout doesn't fit the screen.

The fix: "The game works on desktop but not on mobile. Add touch controls (tap and/or swipe) that mirror the keyboard controls, and make the canvas scale to fit the screen on phones. Keep everything in one file." For action games, you might add: "Add on-screen touch buttons for movement and actions, visible only on touch devices."

Bug 6: "It worked, then I asked for a change and it broke"

You had a working game, asked for one new feature, and now something else is broken. This happens when a change has unintended ripple effects.

The fix: first, go back to the version that worked (this is why it's worth saving a copy of each working version). Then make the request more surgical: "Here is my working game. Add ONLY [feature], and do not change any other behavior. Keep everything else exactly as it is." Being explicit about "don't change anything else" dramatically reduces collateral damage. And always ask for the full file back so you can swap it cleanly.

Save your working versions: Every time your game reaches a state that works, save a copy of the file (e.g. game-v1.html, game-v2.html). If a later change breaks things, you can always return to the last good version. This one habit will save you hours.

The universal debugging prompt

When you're not sure what's wrong, this general-purpose prompt works surprisingly often:

Here is my game (full file below). The problem: [describe
exactly what you see vs. what you expect]. The browser
console shows: [paste any red errors, or "no errors"].

Please find and fix the issue, keep everything in one HTML
file, don't change unrelated behavior, and show me the
full corrected file.

The pattern — what you see, what you expect, any console errors, "don't change unrelated behavior," "full file" — gives the AI everything it needs to fix the problem cleanly.

Key takeaways

  • Learn to open the console (F12) and paste errors — it's the fastest path to a fix.
  • Broken restarts are the #1 AI game bug; ask for a full state reset and cleared timers.
  • No sound is usually the browser blocking audio until first interaction.
  • For mobile, ask for touch controls and a scaling canvas.
  • Save working versions, and make fixes surgical ("change only this").