How To Make Retro Games with Amazon Q Developer CLI
Build classic games faster than ever with AI-powered development
Back in high school, a couple of friends and I built a mobile game where you’d control a circle at the bottom of the screen and avoid the incoming objects until you get to the finish line. We shared the assets, docs, plans, even code (lol, git what?) over Google Drive.
Since it was my first project, I’ll never forget the feeling of getting to play the game I'd worked on. Being able to adjust the speed, point count, music, animations, colors, then hit ‘build’ and fire it up on my phone? So cool!
We had a blast, but eventually steered towards different fields. In my case - backend & cloud.
Now, after a couple of years, that game project still stands alone in my game portfolio (built games one, not the played games one, that one is a different story C:).
Do I want to build a game? I do.
Do I have the time to learn the game dev, C++, C# or something else? Eh, probably not.
But do I need to learn it with all AI tools that are out there? Nope.
Want to skip reading and check out the game right away? Here it is:
https://breakout.kaumnen.com/ (might take a bit to load WASM things at first)
So which game will it be? Breakout
Simple - check
Familiar - check
Replayable - check
Power-ups - check
Fun - check
Can I vibe code it? Spoiler alert: absolutely! But how?
Amazon Q Developer CLI and a Plan
I wanted to check out Amazon Q Developer for some time now, CLI part to be precise. It’s an AI-powered assistant that can generate code, commands, tests, explain something, fix problems, etc. I’ve seen a lot of people recommending it. The full feature set can be found here.
Now I got a project and some free time - let’s finally check it out!
Installing instructions, setup, how does it function - all of that can be found in the docs. There is a free tier too!
Now that I’ve set it up, let’s create a plan.
What are we building? A Breakout game
With what programming language? Python 3.13
What libraries to use? Pygame
There are a few more requirements:
I want it to run on web, so let’s use pygbag for WebAssembly
I want to use uv package manager. If you didn’t check out uv - I can’t recommend it enough, it’s awesome. It really is.
With that, let’s prompt Q chat to create an overview.md file which will contain all the project requirements, what to build, how to build it and so on:
create a detailed overview.md file for building a web based breakout retro game using python 3.13, uv package manager, pygame with pygbag for web assembly
Not the best of prompts, but lets see what will come out of it:
Core tech
Project Structure
Game States
Game Features, Visual Design, Performance Considerations, Dev Workflow in phases, Deployment Options and more
This document (you can find a full version here) will help with model guidance and keep it from steering off course. I didn’t expect it to create a project overview this detailed. Great stuff.
This is an important feature as you want to stay in control. Will it rm -rf / your system on its own? Only if you allow it.
But for our overview.md file - it’s fine.
Tip: When you are using AI assistants/agents, you should have an overview.md, tasks.md, acceptance.md and other files so you can include or reference them during the chat to keep the LLM’s focus on the point.
Implementation
I can start the implementation now. The prompt:
i already have uv installed, start with the project structure and dependencies install
And the result:
What I find cool here is that I see:
Model’s reasoning
The tool it is trying to use
The tool input
The purpose of the tool’s input
It is very detailed.
Different tools will have a different preview. For example, this is what the fs_write tool in action looks like:
It went on to setup the structure and the dependencies. After that, again, a detailed overview:
I went on to finish those next steps one by one, with little to no changes.
After it created a few files - it’s finally ready! I type in y and:
Not a big deal, is it? Happens all the time. The cool thing is that Q Developer CLI has awareness of command outputs, so it can act on the problems without you going back and forth with the model.
After a few changes, the game boots up!
It works, but I noticed a few problems:
Using arrow or A/D keys doesn’t override the mouse control, so the paddle is moving left and right only within the bounds of the mouse-controlled area
Bricks in higher rows don’t have more health than those in lower ones
Collision does not change the ball’s direction of movement
I’ve sent a few prompts to fix these issues, Q Developer CLI did its thing and fixed the issues. Take a look at the sped up video:
Great! Now that the core logic is in place, next up - power-ups!
Tip: don’t prompt it to do multiple things at once. Send precise prompts. If any issues need fixing - write out a few examples to help model understand the issue better. Ideally - point to the file(s) that should be modified. Q is smart enough to find and read them on its own!
I kept sending precise and focused prompts. Testing the game, noting the issues and prompting again. After a few of those - it’s ready!
The power-ups really bumped the fun up a notch! Check it out:
Do note that I did not write a single line of the code or config. Not even a command. Everything you see has been generated so to speak.
The WebAssembly
I think we’re ready to see how it can run in the browser. Sending a new prompt:
lets implement the web part
I intentionally sent a vague prompt to see if it’d remember the pygbag requirement from the overview.md file, and check it out:
It did remember! Then proceeded to:
do a test run
setup a config file for the pygbag
check and refactor existing files to align them with the pygbag requirements
Tried again and.. bingo!
Tip: If you notice, during the chat, that the model is lost, trying some weird things, circling back after the new prompt - just start a new chat to clear the context. Why? The bad responses the model generated stay in the context and will negatively impact the output quality.
Conclusion
Looking back at that old Google Drive folder and my high school game project, it's incredible to see how far technology has come. Building this Breakout game with Amazon Q Developer CLI felt like a huge leap forward.
As for the Amazon Q Developer CLI - it’s great. The interface in which it operates (the CLI) provides so many possibilities, from help with commands (e.g. those scary-looking ffmpeg commands) to full code generation. I plan to test it more, might even stop hitting the Up arrow key 50 times instead of just typing out a command. Or even better - q chat “help”.