How I created a Space shooter game in just 20 minutes using Amazon Q CLI

Sree Krishnan TSree Krishnan T
3 min read

Introduction

I recently discovered the Amazon Q CLI challenge and decided to give it a try. It was worth it. I decided to test this tool by developing a space shooter game, a game that I have developed in the past, so I can compare the time efforts and quality of the game between the two approaches. The best part is that I created the space shooter game in just 20 minutes, while it previously took about 3 days to build the same game.

Installing Amazon Q CLI

For installing Amazon Q CLI, I referred to this link. The Amazon Q CLI uses Claude Sonnet 4, A balanced model for cost and performance.

Creating the Space Shooter Game

One of the standout features of Amazon Q compared to models like ChatGPT and Gemini is its control over the developer environment. It automatically manages everything from the ground up, including installing necessary libraries like PyGame, creating a Python file, implementing code, executing, and testing it. If an error occurs during library installation, it automatically recognizes the issue and tries a different approach until it succeeds.

All of this is accomplished with a single, simple prompt below.

“Develop a space shooter game with PyGame. Install all the required libraries and execute the game"

Testing the Game

To my surprise, the gameplay worked perfectly without any bugs on the first try, which was unexpected since I usually anticipate bugs when developing an application. However, the game was quite simple, which was expected because I only provided a basic prompt with no specific requirements.

So, I decided to improve the gameplay by asking for the following enhancements:

  • Blast effects

  • A realistic background

  • More randomization of enemy ships

  • Extra weapons

As expected, the results met my expectations, and more interestingly, these changes made the gameplay more challenging and fun to play.

The game features

Below are the screenshots from the space shooter game.

The spaceship controls

  • Use WASD or the arrow keys to move left or right.

  • Press space to shoot.

  • Dodge bullets fired by enemy ships.

  • Collect health packs and multi-shooter weapons.

The spaceships

  • Comes in small, medium, and large ships

  • Small ships are fast and weak, while large ships are slow and tough

  • Aims at the player's spaceship and shoots continuously

  • Ships are generated completely at random

Scoring

  • The game starts at wave 1 and proceeds to further waves, where the game gets tougher.

    • The player’s spaceship has 100 health.

    • Once the ship gets destroyed, the Game Over screen is displayed.

  • The player earns points by destroying the ships, as given below:

    • Small ships: 10 points

    • Medium ships: 15 points

    • Large ships: 30 points

This is the overall gameplay of the Space shooter game generated by Amazon Q CLI.

Final thoughts

Amazon Q has the potential to simplify application development by automating many essential steps. It can serve as an assistant for developers working on complex projects, automating tasks to give developers more time to focus on features that need human intelligence.

This article is posted as part of the #AmazonQCLI challenge. #AmazonQCLI

0
Subscribe to my newsletter

Read articles from Sree Krishnan T directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sree Krishnan T
Sree Krishnan T