<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adwitya Chakraborty</title>
    <description>The latest articles on DEV Community by Adwitya Chakraborty (@adwitya_chakraborty_2235f).</description>
    <link>https://dev.to/adwitya_chakraborty_2235f</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3266737%2Fd1efa732-588c-4c19-8d60-70dbd73a3f5d.png</url>
      <title>DEV Community: Adwitya Chakraborty</title>
      <link>https://dev.to/adwitya_chakraborty_2235f</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adwitya_chakraborty_2235f"/>
    <language>en</language>
    <item>
      <title>🎯 Build “Target Collector” Using Amazon Q CLI and Pygame on Linux</title>
      <dc:creator>Adwitya Chakraborty</dc:creator>
      <pubDate>Sun, 15 Jun 2025 13:24:46 +0000</pubDate>
      <link>https://dev.to/adwitya_chakraborty_2235f/build-target-collector-using-amazon-q-cli-and-pygame-on-linux-3c5h</link>
      <guid>https://dev.to/adwitya_chakraborty_2235f/build-target-collector-using-amazon-q-cli-and-pygame-on-linux-3c5h</guid>
      <description>&lt;p&gt;Remember those fast-paced arcade games where every second counts?&lt;br&gt;
Let’s recreate that thrill with Target Collector, a simple reflex-based game built using &lt;strong&gt;Python&lt;/strong&gt;, &lt;strong&gt;Pygame&lt;/strong&gt;, and the AI-powered &lt;strong&gt;Amazon Q CLI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;With Amazon Q CLI, you can generate and modify code in your terminal using plain English prompts — and combining that with Pygame makes the development process smoother and more interactive, especially on a Linux system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ What You'll Need&lt;/strong&gt;&lt;br&gt;
To build Target Collector, I used the following tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon Q CLI&lt;/strong&gt; – An AI command-line coding assistant&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python 3.8+&lt;/strong&gt; – The language driving our game&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pygame&lt;/strong&gt; – A powerful library for building games in Python&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux (Ubuntu/Debian)&lt;/strong&gt; – Recommended environment for easy setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;⚙️ Setting Up the Development Environment (Linux)&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Step 1: Install Dependencies&lt;/strong&gt;&lt;br&gt;
Open your terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install -y python3 python3-pip python3-venv git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Install Pygame&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install pygame
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💻 Installing Amazon Q CLI on Linux&lt;/strong&gt;&lt;br&gt;
Amazon provides a .deb installer for easy setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Download the Installer&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
wget https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Install Using dpkg&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dpkg -i amazon-q.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Fix Any Dependency Issues&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Verify Installation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;q --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the Amazon Q CLI version printed in your terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Launch the Interactive Chat&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;q chat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pe2t4glmr68eir2nzlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pe2t4glmr68eir2nzlj.png" alt="amazonqcli" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You're now ready to build with the help of Amazon Q!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 Building the Game with Amazon Q CLI&lt;/strong&gt;&lt;br&gt;
With everything set up, I started developing the game by feeding prompts into Q CLI. Here's how the game came together, one feature at a time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🎮 Game Concept&lt;/strong&gt;&lt;br&gt;
In Target Collector, you control a blue dot using arrow keys. Yellow targets appear randomly on the screen. You must reach each one within 5 seconds. If you do, your score increases. If not — game over!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧱 Step-by-Step Prompts and Features&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating the Game Window and Player Movement
Prompt:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;“Create a game using Pygame where the player is a blue circle that moves with arrow keys in a 600x400 window.”&lt;/p&gt;

&lt;p&gt;Q CLI Outcome:&lt;/p&gt;

&lt;p&gt;Set up the window&lt;/p&gt;

&lt;p&gt;Added player movement&lt;/p&gt;

&lt;p&gt;Rendered the player as a blue circle&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Spawning Targets Randomly&lt;/strong&gt;&lt;br&gt;
Prompt:&lt;/p&gt;

&lt;p&gt;“Add yellow target circles that spawn at random positions and must be collected within 5 seconds.”&lt;/p&gt;

&lt;p&gt;Outcome:&lt;/p&gt;

&lt;p&gt;Targets appear randomly&lt;/p&gt;

&lt;p&gt;A timer starts as soon as one spawns&lt;/p&gt;

&lt;p&gt;Game ends if the player doesn’t collect it in time&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Visual Timer&lt;/strong&gt;&lt;br&gt;
Prompt:&lt;/p&gt;

&lt;p&gt;“Show a timer bar at the top of the screen that shrinks over 5 seconds.”&lt;/p&gt;

&lt;p&gt;Outcome:&lt;/p&gt;

&lt;p&gt;Timer bar dynamically decreases&lt;/p&gt;

&lt;p&gt;Immediate visual feedback on how much time is left&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Scoring System&lt;/strong&gt;&lt;br&gt;
Prompt:&lt;/p&gt;

&lt;p&gt;“Display a score at the top-left that increases each time a target is collected.”&lt;/p&gt;

&lt;p&gt;Outcome:&lt;/p&gt;

&lt;p&gt;Score starts at 0&lt;/p&gt;

&lt;p&gt;Increases with each successful target&lt;/p&gt;

&lt;p&gt;Updates in real-time on screen&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Game Over and Restart&lt;/strong&gt;&lt;br&gt;
Prompt:&lt;/p&gt;

&lt;p&gt;“On game over, show a message with the final score and allow the player to press R to restart.”&lt;/p&gt;

&lt;p&gt;Outcome:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbp26xz1iopyjz5hmswxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbp26xz1iopyjz5hmswxt.png" alt="game" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Game over screen with final score&lt;/p&gt;

&lt;p&gt;Option to press R to reset the game&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ Final Feature Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🕹️ Smooth arrow-key movement&lt;/li&gt;
&lt;li&gt;🎯 Randomly spawning yellow targets&lt;/li&gt;
&lt;li&gt;⏳ Shrinking timer bar&lt;/li&gt;
&lt;li&gt;🔢 Real-time score display&lt;/li&gt;
&lt;li&gt;💀 Game over screen + restart support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🤖 Why I Used Amazon Q CLI&lt;/strong&gt;&lt;br&gt;
Amazon Q CLI acted like a real-time coding assistant. Instead of Googling syntax or writing logic from scratch, I used prompts to guide development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It helped generate structured code quickly&lt;/li&gt;
&lt;li&gt;I got instant suggestions and bug fixes&lt;/li&gt;
&lt;li&gt;It allowed for rapid prototyping and iteration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perfect for solo developers or beginners looking to learn as they build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 Wrapping Up&lt;/strong&gt;&lt;br&gt;
With just Python, Pygame, and a few well-thought-out prompts in Amazon Q CLI, I built a complete, playable version of Target Collector in record time.&lt;/p&gt;

&lt;p&gt;Want to take it further? Try adding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A countdown sound effect&lt;/li&gt;
&lt;li&gt;Dynamic difficulty (timer shrinks faster over time)&lt;/li&gt;
&lt;li&gt;Persistent high scores stored in a file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📂 Try It Yourself&lt;/strong&gt;&lt;br&gt;
You can run the game like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 target_collector.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the arrow keys to move. Collect yellow targets before time runs out. Press R to restart after the game ends.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;br&gt;
If you liked this post, consider leaving a 👏 or commenting on what game you’d like to build next using AI + Python. Let’s make coding fun again!&lt;/p&gt;

</description>
      <category>python</category>
      <category>aws</category>
      <category>de</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
