DEV Community

dhiraj JDabhi
dhiraj JDabhi

Posted on

How I Built a Game Using Amazon Q CLI

🎮 My Game Using Amazon Q CLI
Hi! I'm Dabhi Dhirajkumar, and I recently built a fun game using Amazon Q CLI. This was part of the Build Games with Amazon Q CLI

🔧 Why I Chose This Project
AWS challenge requirements
Perfect complexity for testing Q CLI
Pygame's simplicity for 2D games
💡 Idea Behind the Game
Describe what your game is about. For example:

I created classic-mario-game. It's simple but fun!

🔧 Tools I Used
Amazon Q CLI
GitHub
Python

I've created a classic Mario-style game for you using Python and Pygame! Here's what I've done:

Installed the necessary dependencies (Pygame)
Created a complete game with the following features: • Mario character that can move and jump • Platforms to jump on • Collectible coins • Enemies that move back and forth • Lives system and score tracking • Game over and win screens
How to Play
To run the game, navigate to the mario_game directory and execute the Python script:

bash cd ~/mario_game ./mario.py

Controls
• Left/Right Arrow Keys: Move Mario left and right • Space or Up Arrow: Jump • R: Restart the game (after game over or winning) • Q: Quit the game (after game over or winning)

Game Objective
Collect all the coins while avoiding or defeating enemies by jumping on them. If you lose all three lives, the game is over.

Game Features
• Mario changes color based on direction (red when facing right, blue when facing left) • Platforms to jump on at different heights • Coins to collect for points • Enemies that move back and forth • You can defeat enemies by jumping on them • Game tracks your score and remaining lives • Win screen when all coins are collected • Game over screen when all lives are lost

The game is simple but captures the core mechanics of classic Mario games. You can extend it by adding more levels, power-ups, or improving the graphics with sprite images instead of the simple shapes I've used.

Enjoy playing your Mario game!

💻 Code Repository
I have shared the full game code here:

GitHub Link to Your Game :- https://github.com/Dabhi-Dhirajkumar/classic-mario-game.git

🙌 Final Thoughts
I learned how to work with CLI tools, use Git, and deploy a game! Thanks to AWS for this experience.

Features
Clean Pygame implementation
Responsive UI
Win/loss detection logic

Top comments (0)