DEV Community

Cover image for How I built Classic Pac-Man game using AmazonQ CLI
2 1 1 1 1

How I built Classic Pac-Man game using AmazonQ CLI

💡 Introduction

Welcome, Devs, to the exciting intersection of Cloud and AI! Today, we're about to take a nostalgic trip back to the good old days, where you might have spent hours playing the legendary Pac-Man game. It’s one of those iconic games that brings back memories of fun, challenges, and those satisfying chases around the maze.

Now, imagine building this classic game without writing a single line of code. Sounds too good to be true? Well, using Amazon Q CLI (Quantum CLI), we can make this happen—yes, you heard that right! In this blog, I’ll walk you through the process of building Pac-Man on your system using just AI prompting. No coding required, just prompt engineering and some cloud magic. Let’s dive in and get the fun started!


💡 Why I Chose Pac-Man

There’s something timeless about Pac-Man. I still remember sitting in front of my screen, fully immersed, dodging ghosts and chasing those little pellets for hours. But no matter how hard I tried, I never managed to actually finish the game. That little yellow guy and I had some unfinished business.

So when I got my hands on Amazon Q CLI, I thought—what better way to explore its capabilities than by recreating a piece of my own childhood? It wasn’t just about building a game. It was about reconnecting with the curious, playful version of myself, all while testing how far AI can go in helping us create something cool without writing a single line of code.


💡 Getting Started with Amazon Q CLI

Before we dive into the fun, we need to get Amazon Q CLI set up on our system.

Since I’m using macOS, I downloaded the Amazon Q CLI DMG installer, just like any regular Mac app. Once the installation was done, I simply dragged it into the Applications folder.

Image description

After that, I opened up iTerm, ran the installation command in my terminal, and gave it a quick restart. The magic happened when I typed q—a sleek CLI chat window popped up, and Amazon Q was ready to go. It felt like I had a friendly AI coding partner sitting right inside my terminal.

Image description


💡 Creating the Game (With Just One Prompt!)

Once Amazon Q CLI was up and running, it was time to put it to the test. I typed in a simple, friendly prompt:

"I am looking to create a Pac-Man game, can you create it for me, install the necessary libraries for it, try to do it in Python."

And just like that, the magic unfolded.

Here’s what Amazon Q CLI did, step by step:

  • First, it checked my system for Python. I had Python 3.13.3 installed, so it gave a green light.

Image description

  • Next, it attempted to install the pygame library using pip. Initially, it failed because I hadn’t set up a virtual environment. No worries though—Q CLI noticed that and automatically created a virtual environment for the project.

Image description

  • Once the environment was ready, it successfully installed pygame, the go-to library for building games in Python.

  • Then came the exciting part: it created the full pacman.py file! 🎮

👉 I’ve hosted the code for the Pac-Man game here:
GitHub Gist - pacman.py

  • To make life easier, Q CLI even generated a run_script.sh file to execute the game smoothly from the terminal.

Image description

  • When I ran the game for the first time, it worked! But there was one little issue—the Pac-Man was running like he had 10 shots of espresso. 🏃💨

So I prompted again:

"The pacman runs too fast, make it normal speed."

Image description

And just like that, Q CLI tweaked the code, adjusted the game speed, and now it runs just the way it should—smooth, fun, and totally playable.

Image description


💡 Conclusion

And just like that, with the help of Amazon Q CLI, I recreated one of the most iconic games of all time—Pac-Man—without writing a single line of code myself. It felt like magic watching an AI understand my intent, set up the environment, write the logic, and even fix gameplay issues, all through simple conversation-like prompts.

This experience wasn’t just about nostalgia—it was a glimpse into the future of software development. Tools like Amazon Q CLI are transforming how we build, letting us focus on creativity and problem-solving while AI handles the heavy lifting.

Whether you're a developer, a hobbyist, or someone just exploring what AI can do—give it a shot. It's fun, fast, and genuinely empowering.

If you enjoyed this post, make sure to follow me for more awesome content around AIDevOps, and Cloud Development:

Let’s keep building the future—one prompt at a time. 🚀

Google AI Education track image

Build Apps with Google AI Studio 🧱

This track will guide you through Google AI Studio's new "Build apps with Gemini" feature, where you can turn a simple text prompt into a fully functional, deployed web application in minutes.

Read more →

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post

👋 Kindness is contagious

Explore this insightful write-up embraced by the inclusive DEV Community. Tech enthusiasts of all skill levels can contribute insights and expand our shared knowledge.

Spreading a simple "thank you" uplifts creators—let them know your thoughts in the discussion below!

At DEV, collaborative learning fuels growth and forges stronger connections. If this piece resonated with you, a brief note of thanks goes a long way.

Okay