Introduction
I recently discovered the "Build Games with Amazon Q CLI and score a T shirt ๐๐" campaign and decided to participate! In this article, I'll share the campaign details and my game development experience using Amazon Q CLI.
๐ Please note: This article is based on and translated from my original Japanese article. Some images may contain Japanese text, but the gameplay and code examples remain universally applicable.
Final Game Demo
Here's what I built (playing at 4x speed):
The entire implementation was done through Amazon Q CLI chat only. I just provided the AWS service icon images.
Pro tip: You could skip even this manual step by instructing Amazon Q CLI to download the icons directly from the AWS Architecture Icons library.
๐ฌ Tip: Click on the image below to see the full animated demo
๐ป Curious about the implementation? You can find all the game code, Docker setup, and step-by-step instructions in my GitHub repository. Note that some features could be further refined, but I've kept the code as-is to showcase the raw output of Amazon Q CLI.
What is Amazon Q CLI?
Amazon Q CLI is an AI-powered development tool from AWS that lets you code through natural language conversations directly in your terminal. Unlike traditional coding methods, you simply describe what you want in plain English, and the AI generates and modifies code for you, dramatically improving development efficiency.
Campaign Overview
This campaign offers a free custom T-shirt for building games with Amazon Q CLI.
Campaign Period: May 20 - June 20, 2025
Eligible Countries:
Australia, Bangladesh, Bhutan, Brunei, Cambodia, China, Fiji,
Hong Kong, India, Indonesia, Japan, Laos, Malaysia, Maldives,
Myanmar, Nepal, New Zealand, Pakistan, Papua New Guinea,
Philippines, Singapore, South Korea, Sri Lanka, Taiwan,
Thailand, Vietnam
Participation Steps:
- Step 1: Install Amazon Q CLI on your machine
- Step 2: Build a game using Amazon Q CLI chat
- Step 3: Share your creation on a blog or social media (in your native language)
- Step 4: Fill out the T-shirt redemption form
1. Development Environment Setup: Windows + WSL + VSCode + Devcontainer
I set up a development environment combining Windows, WSL, and VSCode devcontainer for efficient Amazon Q CLI usage.
1-1. Key Implementation Points
- Since local environment examples exist, I challenged myself with Windows (WSL) + VSCode + devcontainer setup
- Used the GUI-free installation method for devcontainer execution
- Amazon Q CLI doesn't support root user installation, so I used the
--force
option for forced installation
1-2. Dockerfile Configuration
FROM ubuntu:22.04
# Installing required packages
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-pygame \
curl \
unzip \
fontconfig \
fonts-dejavu-core \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Amazon Q CLI
RUN curl --proto '=https' --tlsv1.2 -sSf "https://desktop-release.q.us-east-1.amazonaws.com/latest/q-x86_64-linux-musl.zip" -o "/tmp/q.zip" && \
cd /tmp && \
unzip q.zip && \
cd q && \
./install.sh --no-confirm --force && \
cd / && \
rm -rf /tmp/q && \
rm -f /tmp/q.zip
1-3. devcontainer.json Configuration
{
"name": "Amazon Q CLI Environment",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {},
},
"customizations": {
"vscode": {
"extensions": [
// Install your preferred extensions
]
}
},
// Command to run after container creation
"postCreateCommand": "bash .devcontainer/postCreateCommand.sh",
// Workspace folder path
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}"
}
2. Development Process
2-1. Basic Feature Implementation
I decided to create a Puyo Puyo-style puzzle game.
First, I implemented the basic game functionality by giving Amazon Q this simple instruction:
Create a Puyo Puyo-style game.
Use pygame 2.6.1. Specifications are as follows:
## Basic Specifications
The falling "puyo" should be AWS service icons. Since there's no yellow service, use EC2 as substitute.
Red: CloudTrail
Blue: Aurora
YellowโOrange: EC2
Green: S3
Purple: Amazon VPC
## Controls
Keyboard controls:
- โ and โ for left/right movement
- โ or Space for rotation
- โ for drop
With just this instruction, I got a highly polished Puyo Puyo-style game!
# Basic game structure
import pygame
import sys
import random
import math
# Initialization
pygame.init()
screen = pygame.display.set_mode((600, 700))
:
:
Here's the initial result. Simple but definitely Puyo Puyo-like, right?
๐ฌ Tip: Click on the image below to see the full animated demo
2-2. Feature Enhancement and Improvements
After the basic functionality was working, I added more detailed features through incremental requests:
- Puyo wiggle improvement: Changed from constant wiggling to single wiggle only after landing
- Accelerated drop: The initial "โ for drop" didn't implement proper fast-drop, so I explicitly requested "accelerated drop"
-
Drop prediction: "Display drop prediction point with semi-transparent circles"
-
Chain system: Initial implementation cleared all puyo at once, missing Puyo Puyo's signature "chain" feature. I requested "chains should clear sequentially" and got animated chain clearing!
-
UI improvements: Added total score, max chain counter, Japanese text display - all implemented with simple requests
-
Title screen: Instead of starting immediately, I requested a proper title screen
-
Continue screen: Replaced simple "Press R to restart" with proper Puyo Puyo-style continue screen
2-3. Bug Fixes and Optimization
Development bugs were also resolved through natural language instructions to Amazon Q CLI:
- Function definition order: Fixed errors where functions weren't defined before use, optimizing code structure
- Drop logic fixes: Resolved issues where puyo would stop mid-air after falling
- Freeze issues: Fixed freezing problems that occurred when puyo cleared
- Japanese display: Fixed font settings to use system fonts, resolving character encoding issues
3. Amazon Q CLI Usage Techniques
3-1. Effective Instruction Methods
When using Amazon Q CLI, specific and clear instructions are crucial.
- โ "Improve the game" โ Too abstract
- โ "Fix the issue where icons stop floating in mid-air after falling" โ Specific and clear
Instruction Examples
- Text styling:
Make the text color white with orange outline.
Make it look pop and vibrant.
- Chain system:
When multiple puyo clear, don't clear them all at once - clear them sequentially.
When clearing, make them blink and pop.
For 2+ chains, display "X Chain!" text in the center of the screen.
Make the text orange with black outline.
Make it look pop and vibrant.
- Continue screen:
Add animation where "Amazon Q~" text falls from the top when game over.
Move it to screen center over 2 seconds.
Then start 10-second countdown, display "Continue?" with "Yes"/"No" options.
When countdown expires, fade to black and return to title.
3-2. Incremental Development Approach
Rather than implementing complex features all at once, breaking them into smaller units and developing step-by-step is more efficient:
- First implement basic functionality
- Add features one by one while testing
- Finally adjust visual effects and animations
3-3. Error Handling Tips
When errors occur, providing accurate error messages helps Amazon Q suggest better solutions. Being able to copy-paste error logs directly makes precise information sharing easy.
3-4. WSL + Devcontainer Environment Benefits
- Environment reproducibility: Teams can share identical development environments
- Cross-platform: Develop in Linux-native environment even on Windows
- VSCode integration: Develop without switching between editor and terminal
- Amazon Q CLI compatibility: Smooth execution of Linux version Amazon Q CLI through WSL
Conclusion
Even though this was my first time creating a game, Amazon Q CLI made implementation surprisingly easy. The ability to interact purely through natural language and implement complex features without writing any code myself is truly impressive. Even beginners like me with no specialized game development knowledge can bring ideas to life with AI assistance.
Using WSL and devcontainer makes Amazon Q CLI easily accessible in Windows environments. While some workarounds are needed (like using --force
option for root users), once the environment is set up, you get a smooth development experience.
Through this campaign, I truly experienced the potential of Amazon Q CLI-powered development. Amazon Q CLI isn't just a code generation tool - it's a reliable partner that collaborates with you to solve problems. I encourage everyone to try Amazon Q CLI development!
This article is based on my participation experience in the "Build Games with Amazon Q CLI and score a T shirt" campaign.
Top comments (0)