Build an HTML5 browser game in small steps
A developer used Gemini to assemble a browser game, then recovered from stalled chats by restarting and reloading the code context.
- What they did
- The developer walked Gemini through the game idea, the expected behavior, and the code already in place, then narrowed the task over several turns before asking for an updated script. When the chat began returning a generic failure message, they opened a new conversation, pasted in the related files and the error, and kept testing Gemini’s suggested fixes. The process needed a few rounds of adjustment because some fixes created new problems and some generated markup slipped into the code.
- How it went
- They eventually got a working inventory manager for simple resources, with placeholders left for more complicated items. A recurring "Something went wrong" error blocked progress in the original chat, but restarting with a fresh chat got things moving again.
- Tips
- If the agent starts failing without clear cause, try a new chat and re-send the relevant scripts together. It can also help to split planning and coding into separate chats.
Try it yourself with Gemini
I’m building an HTML5 browser game called [game name]. The player should [core mechanic]. Use plain HTML, CSS, and JavaScript, and start with the smallest playable version. Add [feature 1], then [feature 2], then [feature 3], one at a time. After each change, explain what you changed, then check the code for errors before moving on. If anything needs a risky step like deleting code, overwriting files, or submitting changes, stop and ask me to approve it first. Finish when the game loads and plays without console errors.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Pit three agents against a browser shooter build
Three coding agents independently built the same multiplayer shooter, letting the team compare their strengths and weak spots.
Build a browser 4X game with LLM help
A developer used Grok and Gemini to assemble Hexwardia, a browser-based 4X game, in two weeks.
Use Gemini to generate a match-3 game from one prompt
A single Gemini prompt produced a working Candy Crush-style game and a share link.
Build an agent to play Pokémon Blue from RAM and screenshots
Joel Zhang wired Gemini 2.5 Pro into a Game Boy emulator so it could read game state and press buttons in Pokémon Blue.
Guide a game agent through Goat Simulator 3
SIMA 2 in Goat Simulator 3 can be nudged by a person giving live directions.
Test screenshot-to-click scaling in a simple web game
A developer used Gemini with Playwright to confirm that click coordinates lined up with the browser view.