Build a retro brick breaker game with GLM 5.2 and opencode
This guide walks through building a complete browser game with GLM 5.2 on Venice, using the opencode agent and one prompt at a time. You will see how a high reasoning level lets the model one-shot each feature, from core gameplay to a CRT shell, all in a single HTML file.
- What GLM 5.2 adds over 5.1 and why its higher reasoning modes matter for coding
- How to install opencode and connect it to your Venice API key
- How to select GLM 5.2 with the highest thinking level for best results
- How to build a game incrementally with clear, scoped prompts
- How to keep an entire app in one self-contained HTML file with no external dependencies
What GLM 5.2 brings and what you'll build
GLM 5.2 is an open-weight model that runs privately on Venice. Compared to GLM 5.1, it adds more reasoning modes, including high and max, which let it reason more deeply on long-horizon and agentic coding tasks.
In this guide you build a retro brick breaker game with a CRT screen look, prompt by prompt. The whole project stays in a single HTML file with no external libraries, CDNs, fonts, images, or audio files, so it runs directly in a browser. Each new feature is added with one simple prompt, and the model handles the build without manual fixes.
Install opencode and connect your Venice API key
opencode is an open-source AI coding agent. You can install it for your command line from the command on the opencode homepage, or download the opencode desktop app for your machine. Once installed, launch it by typing opencode in any terminal, then start a new project.
You also need a Venice API key, which you generate in your API dashboard on Venice.ai. With the key connected, opencode can route its requests through Venice so the model stays private.
Select GLM 5.2 with the highest thinking level
In the terminal, run the models command to find and select GLM 5.2:
/models
In the desktop app, use the model menu to pick GLM 5.2 instead. Either way, choose the highest possible thinking level. This is the single most important setting in the guide: GLM 5.2 is a strong coding model, but it needs a high reasoning level to produce reliable, one-shot results.
One-shot the core game
With high-thinking GLM 5.2 selected, paste a clear, scoped prompt describing the core mechanics and the single-file constraint:
We want to build the core of a playable brick breaker game, where you control a paddle like an old retro game and the ball goes up and down to break the bricks. We want this all to be in a single HTML file with no external libraries, CDNs, fonts, images, or audio files. So we want this to be very clean and just work inside of a browser. After we create the base, we'll continue building on top of it.
The model writes a single brickbreaker.html file to your computer and the game is immediately playable. This becomes the base you extend with every later prompt.
Add screens, levels, pause, and an Easter egg
Build features one prompt at a time, always restating that everything stays in one file and keeps the retro green-on-black look. Add a start screen and win screen first:
Add a start screen, press space to start, and a new win screen when all bricks are cleared. Keep the retro green look and keep everything in one file.
Then layer in pause and level progression, batching a few related tasks in one prompt:
Add the ability to pause by pressing space. Add a second level when all bricks are cleared. The next level should have a new brick layout and a 20% faster ball. Show the current level on screen. Add an Easter egg where if I press the S key, the ball speeds up to two times the speed and gameplay continues as usual.
After each prompt, do a hard refresh in the browser and test the new behavior. The high thinking level is what lets the model add several mechanics at once without breaking the existing game.
Add power-ups, sound, and persistent high scores
Next, add catchable power-ups that drop from destroyed bricks:
Occasionally a falling token drops from a destroyed brick, and if you catch it, it widens the paddle by 50% for 10 seconds, then it reverses.
Then add audio and persistence without leaving the single-file constraint. The Web Audio API generates sound without any audio files, and browser storage keeps the high score between sessions:
Add sound effects using the Web Audio API, no audio files. Add a persistent high score and a high score screen that stays stored in our browser.
You can open the source and confirm everything still lives in brickbreaker.html with no fancy dependencies. To verify persistence, set a score, let the game restart, then refresh the page and confirm the high score remains.
Wrap it in a CRT shell, desk, and stormy window
With the game finished, dress it up visually, still in one file. Start with the monitor shell:
Wrap the whole game in a retro CRT computer shell: a chunky dark bezel around the screen, a subtly curved screen with faint horizontal scan lines and a soft glow. Keep the green on black palette and keep everything in one file.
Then refine and add scene elements with follow-up prompts, such as making the shell lighter, adding a desk and an old-school joystick in front of the CRT, and putting a window behind the monitor showing a cloudy day with occasional lightning that illuminates the screen. Each addition is another clean one-shot from a single plain-language prompt, with no manual code edits needed.
Key takeaways
- GLM 5.2 is an open-weight model that runs privately on Venice and adds higher reasoning modes for long-horizon, agentic coding.
- Setting the thinking level to high is what makes GLM 5.2 reliably one-shot each feature.
- opencode plus a Venice API key gives you a private, open-source agent loop for building real apps.
- Scoped, incremental prompts that restate constraints (one file, no external assets) keep a project clean and let the model extend it without breaking earlier work.
- 131votes
- 76votes
- 58votes
Adapted from the @askvenice video on YouTube. Models and prices change fast; verify current details in Venice before production use.