DEV Community

Cover image for ๐ŸŽฎ Build Using Amazon Q
Ayushi Varshney
Ayushi Varshney

Posted on

๐ŸŽฎ Build Using Amazon Q

๐ŸŽฎ Building a Multi-Level 2D Platformer Game Using Amazon Q (On Mac)

amazonqcli #gamedev #ai #webdev

I built a complete 10-level 2D platformer game using just prompts to Amazon Q CLI โ€” with full player mechanics, scoring, audio, and collision detection, all running in the browser!


๐Ÿš€ Overview

As part of the Build Games with Amazon Q CLI challenge, I created a multi-level 2D platformer game from scratch using JavaScript, HTML/CSS, and Amazon Q on macOS.

I didnโ€™t manually write most of the code. Instead, I used conversational prompts to guide Amazon Q โ€” and it generated clean logic, structured visuals, audio support, and modular game systems. The result: a fully working game in just 1 day!


๐Ÿงฐ Tech Stack

  • JavaScript
  • HTML/CSS
  • Web Audio API
  • Amazon Q CLI (in VS Code)
  • No frameworks, pure vanilla setup
  • MacOS for local dev

๐Ÿง  What Amazon Q Helped Me Build

โœ… Player Movement + Jump

Prompt:

Create basic movement for a platformer character with jump logic and gravity.

Q generated physics-based movement with collision checks.


โœ… Coin Collection + Goal Activation

Prompt:

Add coin collection logic and show goal only after all coins are collected.

โœ”๏ธ Coins collected = score increases

โœ”๏ธ Goal appears only when coins = 0


โœ… Audio System (Web Audio API)

Prompt:

Add audio for jump, coin, and background music using Web Audio API.

AI handled browser quirks like user interaction requirements and autoplay restrictions.


โœ… 10-Level Progression System

Prompt:

Add a level system with 10 levels. Make it modular.

๐Ÿ“ฆ Each level defined with:

  • Obstacles
  • Coins
  • Goal position
  • Increasing difficulty

โœ… Game Over Warnings + Restart

Prompt:

Show warning if the player is inactive or fails to reach the goal.

โœ”๏ธ Smart warning system

โœ”๏ธ Restart on failure

โœ”๏ธ Retry with last score displayed


โœ… Visual Platform Customization

Prompt:

Make moving platforms stand out visually.

๐ŸŽจ AI generated stylized platforms with:

  • Beams
  • Rivets
  • Reinforcement effects

๐Ÿ” Debugging & Fixes with Q

Whenever I hit an issue, I just asked Q:

โŒ keys not defined error

โœ… Q: "Define keys object + add key listeners for Arrow/WASD."

โŒ Game state bugs?

โœ… Q: "Fix state handling when goal reached but coins remain."


๐Ÿ Final Result

  • 10 Levels
  • Audio integration
  • Game states (win/lose/pause)
  • Score-based logic
  • Modular folder with HTML/CSS/JS
  • Works in browser + mobile responsive

Image description

๐Ÿ•น๏ธ What I loved: AI didnโ€™t just codeโ€”it understood game flow, logic, UI, and UX.

๐Ÿ’ก What will YOU build with AI?

Drop your creation with #AmazonQCLI and let's inspire each other! ๐Ÿ’ฅ

Top comments (1)

Collapse
 
sujal_b07 profile image
Sujal Burnwal

Amazon Q is pretty cool. I too tried it recently. ๐Ÿค