DEV Community

Cover image for Developing with Prompts: Building a Game Using Q CLI
Aarush Luthra for AWS Community Builders

Posted on • Originally published at aarush7.hashnode.dev

Developing with Prompts: Building a Game Using Q CLI

Have you heard about Q Developer CLI? If you haven’t — it’s a generative AI-powered assistant. From generating bash commands that can be executed directly on your system, querying your AWS account for data, creating code modules, or even building entire games — Q can do it all!

Introduction

Building games can be fun — but also a bit overwhelming. Setting up files, linking levels and what not! It takes time before the fun part arrives..

In this blog, I’ll show you how easy it is to use Q CLI and share the outputs you get from a simple prompt. I built an interactive Dart Game using Q CLI and Pygame which helped me explore Q’s capabilities, all while participating in a fun competition!!

If you build a game using Q Developer CLI, you stand a chance to win a free T-shirt !! Check out the challenge ➡️ Q Dev CLI Challenge

Setting it up

To build my game, I used WSL (it integrates super easily into your windows system)

  1. To install WSL, run the following command
   wsl --install -d Ubuntu
Enter fullscreen mode Exit fullscreen mode
  1. Install Q CLI, to do so refer ➡️ Installing Q CLI

  2. Hit the following command and you are good to go!

q chat
Enter fullscreen mode Exit fullscreen mode

Q CLI

🕹️ What I Built – The Dart Game

As part of the competition, I created a simple but addictive Dart Game using Python and Pygame, powered by Q Developer.

🧩 Game Highlights:

🎯 Level 1: Static dartboard – Learn basic aiming

🎯 Level 2: Moving dartboard – Test timing and accuracy

🎯 Level 3: Moving board + obstacles – The Test!

You get 3 darts per level, and must score enough points to move forward. The dartboard reacts to hit zones (bullseye, middle ring, outer ring), each awarding different scores.

All this was made super easy with help of Q CLI.

My prompts

Q CLI took my prompts and generated exactly what I needed. No setup stress, just describe and the magic begins✨

Whether it was setting up the initial project, linking level logic — Q CLI handled it with ease.

Some of the prompts were:

Add a dart object on the left side of the screen. Make the dart small and sharp, with a red and white tail.

Add controls; Left arrow rotates the dart counter-clockwise slightly while right arrow rotates the dart clockwise slightly. Spacebar or "Throw" button releases the dart in the direction it's pointing.

When thrown the dart travels in a straight line based on its current angle, if it hits the board, stop its motion and show a hit effect.

If some corrections are required, all it takes is another prompt

Editing the changes

Below is an example, as to how beautifully Q summarizes all the changes:

Summarizations

Need more updates and detailed insights as to what was changed? Q CLI covers that too!

Detailed Insights

Check out the code here: GitHub Repo

Check out some snapshots of my game 🎯

Game Start

Level 1

Level 3

My thoughts🤔

The Dart Game might seem simple, but it’s proof of how quickly and creatively you can bring an idea to life with Q Developer CLI. It helps you with everything from debugging to code generation!

Give Q CLI a try — and who knows? You might walk away with a cool game, new skills, and maybe even a T-shirt. 😄

Thank you

Aarush Luthra

Top comments (0)