
Building a Classic Car Racing Game Using Amazon Q CLI in a Single Prompt
Remember those pixelated, top-down car racing games on your old feature phone? The thrill of dodging traffic and hitting perfect turns sparked a passion for speed and strategy that few modern games can replicate. I became completely captivated by those early racing experiences! Now, I’m recreating a classic car racing game using Python and Pygame, with a modern twist—I’m harnessing Amazon Q CLI to accelerate development. So, fasten your seatbelts! We’re building this racing game in just one prompt.
Published May 22, 2025
Installation & Setup: Amazon Q Developer CLI on Windows (WSL)
If you're building a game and prefer working in a Linux environment while on Windows, this guide walks you through setting up WSL (Windows Subsystem for Linux) and installing the Amazon Q Developer CLI using Ubuntu.
Step 1: Install WSL on Windows PowerShell
Open PowerShell as Administrator and run the following command to install WSL:
This command performs the following actions:
- Enables required optional components:
- Windows Subsystem for Linux
- Virtual Machine Platform
- Downloads and installs the latest Linux kernel
- Sets WSL 2 as the default version
- Installs the Ubuntu Linux distribution
- Prompts for a system reboot (if necessary)
- After reboot, you'll be prompted to:
- Set your Linux username
- Set a password
Once completed, you can run Linux commands directly from PowerShell or Ubuntu Terminal.
To switch to the root user, use:
wsl -u root
Step 2: Install Amazon Q Developer CLI in Ubuntu (via WSL)
- Navigate to the Home Directory**: cd**
- Download the Amazon Q CLI (latest release): sudo curl --proto '=https' --tlsv1.2 -sSf https://desktop-release.codewhisperer.us-east-1.amazonaws.com/latest/q-x86_64-linux-musl.zip -o q.zip
- Install unzip (if not already installed): sudo apt install unzip
- Extract the ZIP file: 1) unzip q.zip 2) cd q
- Make the installer executable and run it: 1) chmod +x install.sh 2) ./install.sh
- Reload the shell: bash
- Step 3: Authenticate Amazon Q
Run the following command to log in: q login
This will authenticate your session and allow you to use Amazon Q CLI features, including chat, code generation, and project assistance.

Step 3: Prompt for a Racing Car Game with Amazon Q CLI
Here’s a prompt you can use with Amazon Q CLI to build a simple Racing Car game:
Prompt:
Create a Python game using pygame where a player controls a car that must avoid incoming obstacles. The car should move left and right using arrow keys. Add a scoring system that increases over time as the player survives. End the game if the car collides with an obstacle. Use modular, well-commented code.

To run the game, you'll need to have pygame installed. If you don't have it yet, you can install it with:

pip install pygame


Then run the game with:
python ~/car_game/car_game.py



Reference:
1) For WSL, Set up a WSL development environment
2) Installing Amazon Q for the command line: The essential guide to installing Amazon Q Developer CLI on Windows