Ever wanted to sneak through a maze as a shadowy ninja, dodging guards, grabbing scrolls, and escaping undetected?
Thatโs exactly what I built with Openstate โ a 2D stealth platformer game using Python, Pygame, and scaffolding powered by Amazon Q CLI.
Let me take you through how I made it, what makes it tick, and how you can play it or even build your own.
๐ฎ What is Openstate?
Openstate is a procedurally generated stealth game where you:
Sneak past patrolling guards with line-of-sight vision
Collect hidden scrolls across a maze
Use shadows and bushes to hide
Escape through the exit โ all without being caught
Each level gets harder, and every run is unique thanks to procedural generation.
๐ฅ Gameplay Demo
๐ Watch the full gameplay of Openstate here: https://youtu.be/vvg_KIyrTkg
๐ง Key Features
๐ฏ Cone-of-vision AI: Guards detect you based on realistic field of vision
๐ Procedurally generated levels: New maze every time
๐ Dynamic guard speed: Increasing challenge each level
๐ Scroll collection for stars
๐ฅท Crouch, hide, and sneak to survive
๐ 3-star rating system: Based on scrolls collected, exit reached, and stealth success
๐ Game over + restart system if caught
๐ ๏ธ How It Was Built
๐ Modular Architecture
player.py: Movement, jumping, crouching, hiding
guard.py: AI, patrol logic, detection
level.py: Handles maze, scrolls, exit, guards
maze_generator.py: DFS-based maze generation
ui.py: Timer, star count, detection alerts
๐ป Powered by Amazon Q CLI
Amazon Q CLI helped scaffold the basic architecture for this project โ making it easier to organize the code and scale features over time.
It was part of the "Build Games with Amazon Q CLI" challenge.
๐งช Challenges Faced
Tuning AI to be โdumb but fairโ (nobody likes psychic guards)
Ensuring maze generation always leads to an exit
Getting animations and UI overlays working properly in Pygame
๐ Try the Game Yourself
๐ป Clone the Repo:
bash
Copy
Edit
git clone https://github.com/Kshitij-0007/openstate
cd openstate
pip install -r requirements.txt
python main.py
๐ GitHub Repo: https://github.com/Kshitij-0007/openstate
๐ง Lessons Learned
Procedural generation adds replayability โ but also debugging nightmares ๐
Simple AI systems can feel very smart with just a cone of vision and patrols
Amazon Q CLI can boost productivity and structure โ especially for solo devs
๐ฃ๏ธ Whatโs Next for Openstate?
๐ฎ Smoke bombs to distract guards
๐ง Smarter guard AI variations
๐งฑ Level editor for custom mazes
๐พ Save/load progress
๐๏ธ In-game power-ups like invisibility or speed boost
๐ Final Thoughts
This was built as part of the Amazon Q CLI Game Jam, and Iโm super proud of how it turned out. If you're from Amazon and reading this โ this ninja humbly accepts T-shirt tributes ๐โจ
Thanks for reading, and go give it a try!
Got feedback? Fork it? Want to collab? Letโs connect!
๐ง Built With:
Python 3.9
Pygame
Amazon Q CLI
Canva (video editing)
๐ถ๏ธ Peace, scrolls, and silent footsteps.
python #pygame #gamedev #amazonqcli #opensource #devchallenge #stealthgame #indiedev #proceduralgeneration
Let me know if you'd like a thumbnail image or a post for LinkedIn
too. Let's get this ninja everywhere. ๐ฅท๐ป๐ฅ
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.