AWS Logo
Menu

🚀 Building Prompt Runner using Amazon Q CLI

Prompt Runner, a 2D endless runner game built using Amazon Q CLI—an AI-powered assistant that helped accelerate development and guide coding decisions.

Published Jun 3, 2025

🚀 Building Prompt Runner: A Pygame Project Powered by Amazon Q CLI

Looking to combine game development with GenAI? Let me introduce Prompt Runner, a 2D endless runner game built using Amazon Q CLI—an AI-powered assistant that helped accelerate development and guide coding decisions.
This fun and fast-paced game lets players collect good prompts and dodge bad ones, blending classic game mechanics with real-world AI integration.

🤖 Why Amazon Q CLI?

During development, I used Amazon Q CLI to:
  • Generate code snippets (e.g., for player movement, collision detection, gravity)
  • Debug issues quickly by feeding code blocks directly to the CLI
  • Improve game features like score tracking, animations, and prompt logic
  • Refactor and clean up game structure for modularity
It acted like a real-time AI coding partner. If you haven't tried it—it's a game-changer.

🧩 Core Features

🎮 1. Player Character

  • Smooth jump mechanics using the spacebar
  • Animated running and jumping states
  • Collision detection with falling objects

✉️ 2. Prompt System

  • Green "good prompts": increase your score
  • Red "bad prompts": end the game
  • Prompts fall randomly across the screen
  • Animated with pulsing and rotation effects

⚙️ 3. Game Mechanics

  • Live score tracking
  • Increasing difficulty over time
  • Physics-based jumping with gravity
  • Responsive controls and collision handling

🌄 4. Visuals & Effects

  • Scrolling animated background (clouds, grass)
  • Particle effects when collecting prompts
  • Menus: start screen and game over screen

🧠 Amazon Q in Action: Real Use Cases

Here’s how Amazon Q CLI helped directly during development:
TaskAmazon Q Prompt UsedImplement gravity jump"How to apply gravity in a Pygame jump?"Add falling objects"How to create and animate falling blocks in Pygame?"Animate sprite"How to use sprite sheets in Pygame?"Debug crashes"Why does this Pygame object collide too early?"Clean up code"Can you refactor this into a class-based structure?"
You can ask and iterate using q ask "..." in your terminal. It’s fast and contextual—perfect for live coding or prototyping.

📁 Project Structure

I created two versions of the game for different use cases:

🔹 main.py

A lean, core version with all essential features.

🔹 enhanced_game.py

An advanced version with:
  • Better animations
  • Sound support
  • Particle effects
  • Cleaner structure

🛠️ How to Run the Game

  1. Install dependencies:pip install pygame
  2. Run the game:python prompt_runner/main.py
    # or for the enhanced version:
    python prompt_runner/enhanced_game.py

🎮 Controls

KeyActionSPACEJumpENTERStart / RestartESCQuit game

🔊 Optional: Add Sound Effects

Create .wav files in a sounds/ folder for:
  • jump.wav
  • good_collect.wav
  • bad_collect.wav
  • game_over.wav
These will be triggered contextually during gameplay.

🎨 Customization Options

Customize the game easily by editing variables at the top of the file:
  • Gravity, jump force
  • Screen dimensions
  • Game speed scaling
  • Prompt spawn rate

📸 Screenshots


💡 Want to Expand It?

Here are some ideas to take Prompt Runner further:
  • 🔌 Integrate live Q CLI responses into the game to evaluate collected prompts in real-time
  • 🌐 Add a leaderboard using Flask or Django
  • 🎙 Use voice input to trigger prompt evaluation
  • 🧠 Auto-generate new prompt blocks using Amazon Q’s suggestions

✨ Final Thoughts

Prompt Runner is more than a hobby project—it’s a showcase of what’s possible when you combine Python game development with the power of Amazon Q CLI. Whether you're learning Pygame, exploring AI tooling, or just building something fun, this project makes it exciting and accessible.
Try it out. Build your version. Let AI help you create your next game.

 

2 Comments