# Turn a sketch into a browser game with LongCat 2.5

A piece of toast, three spikes, a blue star and a flag were enough to describe a small platform game. Here’s how to send the picture, play the first build and test a change to its rules.

[HTML](https://lukejbyrne.com/library/guides/xbrfmasbceu/)
Content language: en
Author: Luke Byrne
Video published: 2026-11-15
Guide published: 2026-11-15
Sponsored coverage: LongCat

[Watch the video](https://www.youtube.com/watch?v=XbRFMASBCeU)
Video language: English

- [Try LongCat 2.5](https://longcat.ai/platform/product?utm_source=e40.#platform)
- [LongCat API Quick Start](https://longcat.ai/platform/docs/)
- [Configure Claude Code](https://longcat.ai/platform/docs/ClaudeCode.html)
- [Configure Codex](https://longcat.ai/platform/docs/codex)

## Connect before sending the drawing

Open the LongCat API platform, sign in, choose API Keys and create a key for the project. Copy it to a private environment variable on your computer. Use the Python example from the Quick Start to select the current endpoint and model. A text-only request with the instruction “Reply with READY only” checks your connection before you send the larger image request.

## Give the drawing a rulebook

Sketch the character, hazards, collectible and finish line so each has a distinct shape. Attach the image and describe what the player controls and what counts as a win. For this test I asked for one self-contained HTML file with inline code, a Start button, a single jump and three separate spikes. The first version let the player collect the star for a bonus.

## Play both ways

Save the HTML response as a file and open it in a browser. Jump over the spikes and reach the flag once with the star and once without it. Then change one instruction: the player must collect the star before finishing. Try both routes again. One attempted fix stopped the character from moving. I sent that specific symptom back, then replayed the same routes to check the repair.

## Read the cost of the whole run

Five requests used about 98,000 tokens in total, including a response that cut off and the repair. The estimate for this run was about US$0.06. For your own project, count retries and use the price shown for your account. The links below also open LongCat’s configuration guides for Claude Code and Codex.

## The takeaway

A small change you can test twice makes the game easier to judge. Keep a working copy of the first version so you can replay the exact same jumps after each edit.

## Workflow resources

- [longcat.ai](https://longcat.ai/platform/product?utm_source=e40.#platform)
- [longcat.ai](https://longcat.ai/platform/docs/)
- [longcat.ai](https://longcat.ai/platform/docs/ClaudeCode.html)
- [longcat.ai](https://longcat.ai/platform/docs/codex)

## Chapters

- [0:00 Can AI turn a drawing into a game?](https://www.youtube.com/watch?v=XbRFMASBCeU&t=0s)
- [0:46 Connecting through LongCat's API](https://www.youtube.com/watch?v=XbRFMASBCeU&t=46s)
- [1:03 Creating an API key](https://www.youtube.com/watch?v=XbRFMASBCeU&t=63s)
- [1:22 The Python program](https://www.youtube.com/watch?v=XbRFMASBCeU&t=82s)
- [1:45 Testing the connection](https://www.youtube.com/watch?v=XbRFMASBCeU&t=105s)
- [1:55 Sending the drawing](https://www.youtube.com/watch?v=XbRFMASBCeU&t=115s)
- [2:11 What LongCat saw in the drawing](https://www.youtube.com/watch?v=XbRFMASBCeU&t=131s)
- [2:37 The first version](https://www.youtube.com/watch?v=XbRFMASBCeU&t=157s)
- [3:00 Changing the rules](https://www.youtube.com/watch?v=XbRFMASBCeU&t=180s)
- [3:34 Five requests, 98,000 tokens](https://www.youtube.com/watch?v=XbRFMASBCeU&t=214s)
- [3:58 Playing the final version](https://www.youtube.com/watch?v=XbRFMASBCeU&t=238s)
- [4:24 What you could use this for](https://www.youtube.com/watch?v=XbRFMASBCeU&t=264s)
- [4:49 LongCat in Claude Code and Codex](https://www.youtube.com/watch?v=XbRFMASBCeU&t=289s)
- [5:29 Links](https://www.youtube.com/watch?v=XbRFMASBCeU&t=329s)

## Sources and limitations

The gameplay shown comes from the saved HTML builds. The final section follows LongCat’s published setup guides for two coding tools. The token count and cost estimate describe this example.

[Original video](https://www.youtube.com/watch?v=XbRFMASBCeU)
