🎮Building a Retro Game with Amazon Q CLI

D A GURUPRIYAND A GURUPRIYAN
4 min read

👋 Hello everyone!

Recently I built a fun game called Cube Runner ‘84 (why "84"? I love that number, and you'll play as a cube jumping over obstacles!). The game was inspired from Geometry Dash which I played long before which was fun and sound track was superb. Inspired by Geometry Dash's addictive gameplay and killer soundtrack,

the wildest part is... njan onnum cheythila(I wrote zero code). Amazon Q CLI did all the heavy lifting!

🤖 What is Amazon Q CLI?

Before we begin, let me introduce you to Amazon Q CLI which is a command-line AI assistant by AWS to help developers build software through simple chat. Like ChatGPT in your terminal which creates, writes and even explain what it’s doing. You can refer more about it here: Click Here

🧪 Installation

It was super easy to install. Click Here for Installation Guide. After installation I just ran:

q chat # That's it!

This opened an interactive chat where I could give prompts and built it.

🎮 What I Built: Cube Runner '84

Before I tell you what I built, i will tell you why I built this - I took part in Build Games with Amazon Q CLI and score a T shirt 🏆👕 (Oru t-shirt kittan, just kidding just wanted to try out Amazon Q CLI)

So Cube Runner ‘84 is a minimalist retro game.

🕹️ Game Description

  • A small square block keeps moving forward

  • You press space to jump

  • Avoid obstacles like spikes and blocks

  • The speed increases as you survive longer

  • The background changes color to match retro neon themes

  • You get sound effects and music like old-school 8-bit games

💡 My Prompting Journey

Here are the actual prompts I used in Amazon Q CLI:

  1. Basic game logic

     Create a Pygame game like Geometry Dash using only geometric shapes. The player is a square that automatically moves forward. The player can press spacebar to jump. There are rectangular and triangular obstacles to avoid. If the square touches an obstacle, the game ends.
    
  2. Add cool background

     Add a scrolling background made of lines or faded shapes that creates a feeling of motion. Change the background color every 10 seconds. Use neon color themes.
    
  3. Add score and difficulty

     Add a score counter that increases with time. Every 15 seconds, increase the speed slightly. Display "Game Over" and score when the player dies.
    
  4. Add music and sound

     Add a looping 8-bit music track and simple sound effects for jumping and crashing.
    

Each time I ran a prompt, Amazon Q CLI created or edited the code in the background. I could test the game immediately after each change.

💬 How AI Handled Classic Challenges

  • Collision Detection – Triangle + Rect? Done in a few lines

      # Triangle hitbox magic!
      if obstacle.shape_type == "triangle":
          hitbox = pygame.Rect(
              obstacle.x + obstacle.size//4, 
              obstacle.y + obstacle.size//4,
              obstacle.size//2, obstacle.size//2
          )
    
  • Dynamic Difficulty

      # Every 15 seconds: speed up + show notification
      if current_time - last_speed_increase > 15000:
          game_speed += 0.5
          show_speed_notification = True
          sound_manager.play_sound('speed_up')
    
  • Beat-Synced Visuals

      # Background color changes to music beat
      if beat_occurred:
          bg_color = (
              random.randint(10,30),
              random.randint(10,30),
              random.randint(20,40)
          )
    
  • Procedural Audio Generation

      # Auto-generated jump sound
      def create_jump_sound():
          samples = int(0.3 * 44100)
          buf = bytearray(samples * 2)
          for i in range(samples):
              freq = 800 - (400 * i/samples)
              buf[i*2] = int(math.sin(freq) * 127 + 128)
    
  • Neon Pulse Effect

      # Cubinte glow effect
      glow_size = int(self.size + 4 + 2 * math.sin(self.pulse_effect))
      glow_surface = pygame.Surface((glow_size, glow_size), pygame.SRCALPHA)
      pygame.draw.rect(glow_surface, (*self.color, 100), (0,0,glow_size,glow_size))
    
  • Player Trail

      # Cube leaves neon trail
      self.trail.append((self.x + self.size//2, self.y + self.size//2))
      for i, pos in enumerate(self.trail):
          alpha = int(255 * (i / self.trail_max))
          pygame.draw.rect(screen, (*self.color, alpha), pos)
    

It saved me hours I would’ve spent googling minor issues. The AI handled 90% of logic — I just tweaked for feel.

📸 Screenshots of the Game

🧠 What I Learned

This project was more than just code. I was just experimenting on vibe coding or child coding just like Derek Bingham and Haowen Huang talked about in their blogs. We just need to start with something you dream to build and prompt naturally and iterate through chat. Final product will be something amazing. If you are a developer, you can improve the product to the next level.

🔗 Try It Out

GitHub Repo: https://github.com/thisis-gp/Cube-Runner-84

🎮 Play Online: https://thisis-gp.github.io/Cube-Runner-84/

🔗 Try It Out

Amazon Q CLI isn’t just a coding tool, it is like a having a tech-savy friend who understands and fixes it instantly with great explanations. Just install and start chatting. I think it comes under vibe coding.

Just install, open a chat, and vibe-code your dreams. 💬🎮

Posting this as a part of #Amazon Q CLI challenge. #AmazonQCLI #Python #Pygame #VibeCoding

0
Subscribe to my newsletter

Read articles from D A GURUPRIYAN directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

D A GURUPRIYAN
D A GURUPRIYAN

I'm eager to leverage my knowledge and practical experience to contribute meaningfully to the tech industry. I'm a lifelong learner who enjoys staying updated on the latest tech trends and mentoring aspiring programmers. Outside of coding, you'll often find me engrossed in a book or tackling challenging puzzles. Excited about the ever-evolving world of computer science, I'm ready to embark on the next exciting chapter in my journey.