Building a Memory Matching Game with Amazon Q CLI + Pygame
Introduction:
In this blog, I walk through how I built a 2D memory matching game using Amazon Q CLI, an AI-powered coding assistant by AWS, combined with Python and the Pygame library.
As someone exploring the intersection of AI and interactive tech, I was amazed at how Amazon Q CLI guided me through every step — from game logic to visual layout — simply by chatting with it. It was like pair programming with an AI mentor.
This project was part of the “Build Games with Amazon Q CLI” challenge, and it opened up a new creative path for me — showing how AI can help bring even small, personal game ideas to life quickly and powerfully.
How I Got Started:
To begin, I followed these steps:
Step 1: Set up an AWS Builder ID
You need this to use Amazon Q CLI and join the AWS Builder community. It only takes a few minutes:
https://community.aws
Step 2: Install Amazon Q CLI
I installed the CLI on my local machine using the official instructions:
For Windows
For Linux
Step 3: Install Python + Pygame
I used Python (3.x) and installed Pygame with:
bash
Copy
Edit
pip install pygame
With these tools ready, I opened Amazon Q CLI, typed in my game prompt, and began building.
What I Built:
I created a Memory Matching Game — a fun, visual challenge where the player flips over cards to find matching pairs.
The gameplay includes:
- A grid of face-down cards
- On click, two cards are revealed
- If they match: they stay visible; if not, they flip back
- The game ends when all pairs are matched
- This game is perfect for kids, educators, and even beginners learning pattern recognition.
How I Built It Using Amazon Q CLI:
In the CLI, I prompted:
_"Create a simple 2D memory matching game using Python and Pygame."
_
Amazon Q responded with step-by-step code that handled:
- Setting up the display window
- Drawing cards in a grid
- Detecting user clicks
- Matching logic with memory resets
- Showing success messages when the game was complete
I made a few changes to:
- Adjust the colors
- Add font styling
- Replace symbols on the cards
- Improve timing for mismatched card resets
This was one of the smoothest experiences I’ve had turning an idea into a game — thanks to the conversational nature of Amazon Q CLI.
Watch the game in action here:
🎥 https://youtu.be/t7_quSR229w
Reflections:
Using Amazon Q CLI truly changed the way I think about coding.
Rather than starting from scratch, I could collaborate with AI, adapt what it gave me, and learn while building. It felt empowering — especially as someone passionate about building tech that’s accessible and supportive of real-life needs.
I could see how this would help:
- New coders learning Python
- Teachers creating simple educational games
- Parents introducing kids to game logic
- For me, it also connects to my deeper mission through MDBot for Her — supporting women in tech by encouraging creativity, visibility, and growth.
Try It Yourself!
Want to build a game with just a few prompts?
Start chatting with Amazon Q CLI and see how far your imagination goes.
This campaign runs until 30 June 2025, and if you’re in Asia Pacific, Japan, or Greater China, you’re eligible for a free Amazon Q T-shirt!
Top comments (0)