DEV Community

Build a game using Amazon Q CLI - 2048 Game

Amazon Q CLI

Build Games with Amazon Q CLI” campaign is all about getting hands-on experience with an AI coding assistant and letting your creativity and imagination bring a new game to reality using Amazon Q CLI, at our own time and at our own phase.

Step 1 : create an AWS Builder ID and claim our unique community.aws username.

You can access from this link.

Step 2 : install Amazon Q on our machine.

In this case, i am using macbook as base OS.

Install Homebrew if not installed

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Install Amazon Q CLI

brew install amazon-q
Enter fullscreen mode Exit fullscreen mode

but, after installation finished, i can't access amazon q cli with command by type q on my terminal. Turn out that the application already in my Applications folder. Double click to open the GUI of amazon q or use Spotlight.

First time we open Amazon Q GUI
Amazon Q UI

Setup Shell Integrations, click Install
Shell Integration

Allow Acccesibility on Our machine
Accesibility

Amazon Q CLI available on my terminal after close and open the terminal
Terminal iterm

We successfully install and setup Amazon Q CLI. Now we need to login with our Builder ID.

Login with AWS Builder ID
Login with builder ID

We will redirect to browser access to login and allow access
Allow Access

Access granted
Notification access granted

Successfully login with AWS Builder ID
Successfully login

Step 3 : Install Python and PyGame Library

Install Python

brew install python3
Enter fullscreen mode Exit fullscreen mode

Install PyGame python library with pip

pip install pygame
Enter fullscreen mode Exit fullscreen mode

Step 4 : Play with Amazon Q CLI

Check Amazon Q cli with type q on terminal.
First, i ask the Q can he make me a game. Then ask for game 2048.

Amazon Q

He successfully created game, add some descryption and give the instruction how to run the game.

Image description

This is the game result.

Image description

I ask the Q to rewrite some modification on color looks of the 2048 game.

Image description

He gave the result and add some descryption.

Image description

This the result game.

Image description

And the Game Over game.

Image description

Also asking to add some functionality to the game.

Image description

Amazon Q successfully response with some information about the game functionality.

Image description

This is the end of game result.

Image description

This is it!.. My first experience on Amazon Q CLI on my MacOS.

Hope this article useful for you.

Top comments (0)