Game development challenge using Amazon Q CLI


Here’s the challenge I recently participated in after a long time and thanks to Soumyadeep Mandal [Sam da] for informing me and help me explore something new. Refer to this blog to know more about the challenge. In brief, we have to create a game using Amazon Q CLI and I will share all the prerequisites, commands and explain as I dive deeper.
Prerequisites
Windows 11 with WSL (version 2)
Python latest version
Reference links
Documentation: https://help.ubuntu.com
Create aws builder id: https://docs.aws.amazon.com/signin/latest/userguide/sign-in-aws_builder_id.html
Setup
Distribution setup
wsl -l -v
is to check if any distribution is already installedwsl.exe --list --online
is to check list of valid distributions that can be installedwsl.exe --install Ubuntu-24.04
to install the Ubuntu version 24.04wsl.exe -d Ubuntu-24.04
to launch the distribution
If you see that UBUNTU is running it means in some tab, it is already launched and you are working inside it.
Create an username and password for root user
sudo apt update
refreshes the list of available packages and their versions from online repositoriessudo apt upgrade -y
installs the latest versions of all installed packages without asking for confirmation
Amazon Q CLI setup
wget
https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q.deb
is to install Amazon Q CLIsudo apt-get install -f
fixes broken dependencies by attempting to install missing packages required by previously failed installations.sudo dpkg -i amazon-q.deb
installs the amazon-q.deb package manually using the Debian package manager.
You may get an error after running these commands which will look like this, just run
sudo apt --fix-broken install
, it will install the dependencies causing errorRun
sudo dpkg -i amazon-q.deb
again and then q loginUse ⬆️/⬇️ to navigate and point to “use for free with builder ID”
Press enter and you get something like this, simply copy the url and open in your browser
Log in to your AWS builder ID and confirm the code.
Run q to start the Amazon q and you will get an interface like this
- You are now ready to send prompt and develop your game
My entry
I have hosted the code on GitHub which you can try out, just download the file and run it using Bash. Now I choose to create the simple traditional Snakes and Ladder game which can have 2 players as it has been my most favourite since childhood.
Prompt
My prompt was very simple. After 10-15 iterations of prompting, I got the best version.
Create a traditional snakes and ladder game which will have snakes and ladder that stays at random 10×10 window and decreases or increases the code accordingly. There should be some background music, with a sound on every dice roll. There should be some shortcuts, and make sure it has a nice visuals.Keep track which players chance to roll the dice, and the change in their score.
Visuals
Rules
🎯 Play the Game:
• Click "ROLL DICE" button or press SPACE to roll the dice
• Watch your player piece move around the board
• Experience snakes that take you down and ladders that boost you up
• Try to reach position 100 first to win!
🎵 Enjoy the Audio:
• Background music is playing automatically (soft melody loop)
• Sound effects play for dice rolls, moves, snakes, ladders, and winning
• Click the "♪ ON/OFF" button or press 'M' to toggle music
• Press 'S' to toggle sound effects
🎨 Visual Features:
• Colorful game board with numbered cells
• Red snakes and green ladders with descriptions
• Player pieces with numbers and current player highlighting
• Move history and game statistics
Side challenge
Apart from this, I have been trying to develop a space adventure game called Space adventure to Pluto. I have been facing issue debugging error as to why my spaceship cannot navigate to left and right otherwise.
Conclusion
After returning from work and working on it by staying up late at night, trying to generate the code, run it, understand and debug errors only to rectify and regenerate the code with some new feature in each iteration, it was fun!
Subscribe to my newsletter
Read articles from Saumili Dutta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
