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.

Done with Gemini· Advanced

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.

Read the original on itch.io ↗

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.