Game development challenge using Amazon Q CLI

Saumili DuttaSaumili Dutta
4 min read

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

Setup

Distribution setup

  • wsl -l -v is to check if any distribution is already installed

  • wsl.exe --list --online is to check list of valid distributions that can be installed

  • wsl.exe --install Ubuntu-24.04 to install the Ubuntu version 24.04

  • wsl.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 repositories

  • sudo apt upgrade -y installs the latest versions of all installed packages without asking for confirmation

Amazon Q CLI setup

  • 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 error

  • Run sudo dpkg -i amazon-q.deb again and then q login

  • Use ⬆️/⬇️ 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!

0
Subscribe to my newsletter

Read articles from Saumili Dutta directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Saumili Dutta
Saumili Dutta