DEV Community

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

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Ā AI,Ā DevOps, andĀ Cloud Development:

Let’s keep building the future—one prompt at a time. šŸš€

Top comments (1)

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