
Grilling Games: Build Burger Stacker with Amazon Q Developer CLI
Create an engaging Burger Stacker game using Amazon Q Developer CLI. This step-by-step guide covers everything from setting up your development environment to prompting Q to generate the code and documentation for the game.
Published Jun 10, 2025
Last Modified Jun 12, 2025
Just a quick note - you can see the working version of the game on GitHub Pages. Give it a try before we dive into how it was built: https://glennchia.github.io/burger-stacker-game/
In this post, I’ll guide you through the process of using Amazon Q Developer CLI to create a fun game called Burger Stacker. This project combines my passion for food, coding, and the power of generative AI.
I’ll share the entire journey, from setting up the Q Developer CLI and crafting effective prompts to designing the game’s UI. Let’s dive in and see how AI can assist in bringing a delicious game idea to life!
The screenshot below shows the UI of the game play. In Burger Stacker, you'll be presented with a colorful burger stack on the left side of the screen. Your goal is to recreate this pattern by pressing the corresponding color keys in the correct order, building your burger from bottom to top. Each correctly matched stack earns you points equal to the number of layers in the stack. The game lasts for 60 seconds, and your objective is to match as many stacks as possible to achieve the highest score!

The code to play the game can be found at the burger-stack-game GitHub repo. This repo contains the following:
- Code that Amazon Q CLI generated. Found at burger-stacker-game/q-generated-files.
- Sequence of prompts and Amazon Q CLI actions used to derive the final game. Found at burger-stacker-game/prompt-sequence.md.
Follow the instructions at Amazon Q Developer documentation on installing the Q Developer CLI depending on your OS
Once installed, start the Q CLI chat in the terminal with
q

Several best practices for prompt engineering are outlined in Anthropic's Prompt Engineering Overview documentation. For this particular blog I used Claude to generate a prompt for Claude. I briefly described the game mechanics and asked Claude to generate a prompt for Q Developer CLI which was itself running on Claude 3.7. Refer to Amazon Q Developer documentation for more information on the models available on the Q Developer CLI.
The prompt generated was:

Entering this prompt gave enough information for Q Developer CLI to generate the initial files. At each action Q asks for permissions to allow the action.

After allowing each action, Q generates a
burger_stacker.py
, README.md
, and requirements.txt
following the instructions specified. To keep the blog brief, refer to prompt-sequence.md for more screenshots of the various approvals for each step. At this stage the UI was functional but did not look great.
Another 2 rounds of prompts were used to enhance the look of the UI and improve the game play experience. The sequence of prompts and screenshots can be found at prompt-sequence.md.
Enter the second prompt to switch to a dark theme and give the game's UI an arcade feel.
The Q Developer CLI followed the instructions and generated the following UI. Notice that there is a bug in the UI where the "Instructions" text overlaps with the instructions. This will be fixed with the next prompt.

The final prompt instructed Q Developer CLI to fix the UI bug and enhance the gameplay.


Some highlights from the generated code at burger-stacker-game/q-generated-files/burger_stacker.py.
Game Loop Management: Amazon Q CLI helped generate a robust game loop that handled player inputs and game state updates efficiently. This includes tracking the count down timer and reseting games. There was also a very nice progress bar that showed the time ticking down.
UI Design: No effort was needed to draw the burger and iterate on the drawing. The code below was fully AI generated.
Score Persistence: Amazon Q CLI persisted scores to a local file such that the overall high score could be tracked and displayed across sessions.
Creating Burger Stacker with PyGame and Amazon Q Developer CLI turned out to be a fun evening project. Looking back, tinkering with the Q Developer CLI was way more enjoyable than playing the game itself. That said, if you want to try out the game I created, feel free to give it a test run at burger-stacker-game/q-generated-files.