Building a Human vs AI Pong Game Using Amazon Q CLI and Python

Avi SinghAvi Singh
2 min read

In the world of game development, creating a simple yet engaging game can be a rewarding experience. Recently, I embarked on a project to build a classic Pong game where a human player competes against an AI opponent. This project not only allowed me to explore game mechanics but also introduced me to the Amazon Q CLI, which streamlined my development process. In this blog post, I’ll share my journey of creating the "Human vs AI Pong" game, the challenges I faced, and how Amazon Q CLI helped me along the way.

Why Amazon Q CLI?

Amazon Q CLI is Amazon’s AI-powered assistant designed to boost developer productivity. It helps generate, debug, and improve code right from the terminal. For this project, I used Amazon Q CLI to:

  • Understand Pygame module structures

  • Generate boilerplate for game loops and menus

  • Improve AI paddle logic for different difficulty levels

  • Add sound and music integration

  • Create glowing visual effects and animated transitions


About the Game

Human vs AI Pong is a two-player game — except the second player is a smart AI. You can choose from Easy, Medium, and Hard difficulties, and the AI responds accordingly. The game includes:

  • Dynamic ball effects (rainbow ball, trailing particles)

  • Background music and hit sound effects

  • Game states: Main Menu → Difficulty Select → Gameplay

  • Restart Option after a match ends


How Amazon Q CLI Helped

Prompt used for creating game

It generated the full loop with music loading, event checks, and clean structure. I then customized the rest to fit the game.

Screenshots

Lessons Learned

  • Using AI tools like Amazon Q CLI accelerates development, especially for game mechanics and visual polish.

  • Structuring your game into modules (paddle, ball, effects) keeps it clean and extendable.

  • Adding polish like audio, menus, and effects makes even a simple game feel professional.

Final Thoughts

Building this game was a fun dive into Pygame and AI-powered coding. Thanks to Amazon Q CLI, I was able to focus more on creativity and less on boilerplate.

Github Repository #AmazonQCLI

0
Subscribe to my newsletter

Read articles from Avi Singh directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Avi Singh
Avi Singh