AWS Logo
Menu
Build a Bomberman-Inspired Game with Python & Amazon Q CLI

Build a Bomberman-Inspired Game with Python & Amazon Q CLI

Code your own Bomberman-style game in Python using Amazon Q CLI. Add levels, enemies, and custom features for a retro-inspired terminal game.

Published May 22, 2025

šŸŽ® Introduction

Inspired by the nostalgic charm of the original Bomberman, I built a fully playable Bomberman-style game using Python, Pygame, and Amazon Q CLI. This guide walks through how to set up the environment using WSL and how I used a series of natural language prompts to get Amazon Q to generate and refine the game code.

šŸ› ļø Prerequisites

  • Windows 10 or 11 with WSL enabled
  • Ubuntu installed via WSL
  • Python 3.9+ installed on WSL
  • Pygame installed (pip install pygame)
  • Amazon Q CLI installed and authenticated

šŸš€ Step 1: Set Up Your Environment -

Install Python and Pygame in WSL
sudo apt update && sudo apt install python3 python3-pip -y
pip3 install pygame
Install Amazon Q CLI
Download the installer here
Launch the CLI:
q

✨ Step 2: Prompts Used to Build the Game -

Here are the actual prompts I used during development in Q CLI:
1. Create a classic Bomberman-style game using Pygame with the following features:
- Grid-based movement system with player controlled by arrow keys and X to place bombs
- Destructible and indestructible walls with distinct textures
- Bomb placement with timed explosions that can destroy walls and defeat enemies
- Multiple enemy types with unique appearances that move randomly around the grid
- Level progression system where killing all enemies reveals an exit gate
- Gate interaction where the player must stand on the gate and press I to advance
- Increasing difficulty with more enemies in each subsequent level
- Status display showing current level and remaining enemies
2. Make the enemy look like a proper enemy character.
3. Add collision detection so that the player dies if they run into an enemy.
4. Improve the UI and expand the game window.
šŸŽØ Features Implemented
Smooth tile-based player movement
Destructible bricks and indestructible walls
Bomb placement and timed explosion logic
Multiple enemy types with visual distinction and random movement
Player death upon contact with enemies
Gate system for progressing to the next level
ā–¶ļø How to Run the Game
From your terminal or VS Code :
python3 main.py
Controls:
  • Arrow Keys – Move the player
  • X – Drop a bomb
  • I – Enter gate after defeating all enemies
  • R – Restart the game (after Game Over)šŸŽ® Game window :
    Bomberman
    Game

How to Start and Play the Bomberman Game

## Getting Started
1. Requirements:
• Make sure you have Python 3.x installed on your computer
• Install Pygame by running: pip install pygame
2. Download the Game:
• Download the game files (main.py and the assets folder)
• Place them in a directory of your choice
3. Launch the Game:
• Open a terminal/command prompt
• Navigate to the game directory
• Run the command: python main.py
## Game Controls
• Arrow Keys : Move your character around the maze
• X Key: Place bombs to destroy blocks and defeat enemies
• I Key: Enter the exit gate to proceed to the next level (when standing on it)
• R Key: Restart the game after losing
• Escape Key: Quit the game
# How to Play
1. Objective: Destroy all enemies on each level, find the exit gate, and advance through increasingly difficult levels.
2. Basic Gameplay:
• You control a Bomberman character who can move in four directions
• Navigate through the maze, avoiding enemies and placing bombs strategically
• Bombs explode after a short delay, creating explosions in four directions
• Explosions destroy destructible blocks (brown) and defeat enemies
3. Enemies:
• Enemies move randomly around the maze
• If you touch an enemy, you die
• Defeat enemies by catching them in bomb explosions
4. Finding the Exit:
• The exit gate is hidden under one of the destructible blocks
• You must destroy all enemies to reveal the exit gate
• Once all enemies are defeated, find the gate (it pulses with a yellow glow)
• Stand on the gate and press the I key to advance to the next level
5. Progression:
• Each level has more enemies than the previous one
• The status bar at the top shows your current level and remaining enemies
• When all enemies are defeated, the enemy counter turns green
## Tips for Beginners
• Be careful not to get caught in your own bomb explosions
• Use bombs to create paths through destructible blocks
• Try to trap enemies in confined spaces before bombing them
• Watch the enemy counter to know when all enemies are defeated
• Remember that bombs explode in four directions, so position yourself safely
Good luck, and have fun playing Bomberman!
🧠 Key Learnings
  • Amazon Q CLI dramatically speeds up prototyping
  • Pygame is beginner-friendly and perfect for retro games
  • Breaking development into Q-prompted steps allows easy iteration and debugging
Ready to Dive In?
Grab the code, fire it up, and start experimenting. Want to add your own soundtrack? New levels? Wild obstacles? Go for it - this is your sandbox to play in.
Explore the GitHub Repo: https://github.com/gangadhar1718/bomberman-game
Ā 

Comments