# How Fountain keeps code generation on track for browser-based mobile games

DevFeed: [How Fountain keeps code generation on track for browser-based mobile games](<https://devfeed.tech/articles/code-generation-that-just-works-21576.md>)

Original publisher: [Read original article](<https://maryrosecook.com/blog/post/code-generation-that-just-works>)

Published: 2026-03-27T07:00:00Z

Content type: article

Language: en

Sources: [Mary Rose Cook](<https://devfeed.tech/sources/mary-rose-cook.md>)

Topics: [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Code](<https://devfeed.tech/topics/code.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [WebGL](<https://devfeed.tech/topics/webgl.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Canvas](<https://devfeed.tech/topics/canvas.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [browser](<https://devfeed.tech/tags/browser.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [canvas](<https://devfeed.tech/tags/canvas.md>), [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [computer](<https://devfeed.tech/tags/computer.md>), [developer](<https://devfeed.tech/tags/developer.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [interface](<https://devfeed.tech/tags/interface.md>), [language](<https://devfeed.tech/tags/language.md>), [model](<https://devfeed.tech/tags/model.md>), [render](<https://devfeed.tech/tags/render.md>), [tool](<https://devfeed.tech/tags/tool.md>), [user-interface](<https://devfeed.tech/tags/user-interface.md>), [vector](<https://devfeed.tech/tags/vector.md>), [webgl](<https://devfeed.tech/tags/webgl.md>)

## AI overview

The author describes Fountain, a game-making tool that uses a predefined framework, built-in systems, manipulable user interfaces, and a constrained target domain to keep generated code aligned while creating simple mobile arcade games.

## Source excerpt

About nine months ago, my son said he wanted to make a video game. He said it was called Exploding Kitties. We made it together on my computer. He described the gameplay and drew the graphics. I vibed the code. The game basically worked. But we had to build it in small pieces. And, periodically, I had to spend time in the guts of the code, getting it back on the rails. Unifying two ways of doing the same thing. Fixing gnarlier bugs. Disentangling the game code from the engine. Today, I know that we'd be able to one-shot Exploding Kitties. The first reason: models and agent harnesses produce much higher intelligence. But, the second reason, the one I want to talk about, is the supporting techniques and environment. I've built a new game-making tool called Fountain. You can one-shot any simple mobile arcade game. Or, you can iterate your way to a more complex game and the code stays on the rails over many turns. Here's why it works - A framework that supplies decisions and built-ins Every game is given a game framework upfront. This framework encodes many decisions. That game entities have a certain data shape. That behavior abstraction is done with prototypal inheritance. That the coordinates of an entity represent its top left. This keeps the code generation aligned. And this framework includes generally useful built-ins. An update/event/draw loop. A WebGL canvas render surface. A collision detection and resolution system. A particle system. A system to detect input. This reduces the amount of code that must be generated. A manipulable artifact Prompting can be tiresome. Language is ambiguous. The model can interpret a prompt in a way the game designer didn't intend, and make the wrong change. Language is clumsy. It's hard to precisely indicate any point in a continuum. A color. A point. An amount. But there's a solution. Do it the old way. Give the game developer a user interface through which to express their intent. A color picker to choose the color of the water