Pac-Ghost - A battle-royale style maze game inspired by Pac-Man

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: That's Entertainment! What I Built Pac-Ghost turns the classic maze into a battle-royale: you're the blue ghost competing against nine colorful AI ghosts. Demo Use Python and PyGame to run it: https://github.com/fabiocore/pac-ghost Code Repository https://github.com/fabiocore/pac-ghost How I Used Amazon Q Developer In the project's directory I've created a file called GAME.md and used the feature of 'Context management and profiles' of Amazon Q (https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-context-profiles.html) to add the file. The GAME.md file has some guidance for the Amazon Q on what is the project is, about the game, how I would like the game to be and other things like mechanics, look and feel and etc. 1 PROMPT Let's create a new Game using PyGame. Use the context(GAME.md file) to understand what we will gonna build. Plan first, Think step by step, think hard. The response from Amazon Q was: After some time waiting Amazon Q developing the game, I got the first working version of the game, with some issues that I ask it to solve, so iterate with my second prompt. 2 PROMPT OK, I guess we are almost there, but we need to fix some things. The level is not visible, although I can see it, is kind inside the ghost image and the lvl is not easy to read. The IA ghosts are cheating, they kill me passing through the walls without respecting the maze walls. I was able to kill another ghost in the same level as me, If the ghosts are in the same level, both got killed. I would like the game looking and feel like the original classic PacMan with black background and blue walls like 1980 game. After the second iteration, the ghosts are still cheating, but the speed was better. 3 PROMPT ok, for some reason the ghosts are still cheating. I saw them ignoring the maze walls. Besides that, when they are 'cheating' the also increase their own speed at insane speed! The speed should be equal at start, and only when a ghost level up it gots a little bit more speed, not much. Also, I got the below error in the console(although the game is working) :488: RuntimeWarning: Your system is avx2 capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation. pygame 2.5.2 (SDL 2.30.0, Python 3.12.3) Hello from the pygame community. https://www.pygame.org/contribute.html Could not load sound file: pickup.wav, error: RIFF form type is not WAVE (not a Waveform file) Could not load sound file: elimination.wav, error: RIFF form type is not WAVE (not a Waveform file) Now the ghost are better, but still cheating for some reason. I guess the machines find out its way to break the rules too. :D But I'm satisfied with the current version of the game and perhaps I'll iterate more on the future and add some features. That's all! Thank you!

May 6, 2025 - 02:09
 0
Pac-Ghost - A battle-royale style maze game inspired by Pac-Man

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: That's Entertainment!

What I Built

Pac-Ghost turns the classic maze into a battle-royale: you're the blue ghost competing against nine colorful AI ghosts.

Demo

Use Python and PyGame to run it:
https://github.com/fabiocore/pac-ghost

Code Repository

https://github.com/fabiocore/pac-ghost

How I Used Amazon Q Developer

In the project's directory I've created a file called GAME.md and used the feature of 'Context management and profiles' of Amazon Q (https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-context-profiles.html) to add the file.

The GAME.md file has some guidance for the Amazon Q on what is the project is, about the game, how I would like the game to be and other things like mechanics, look and feel and etc.

1 PROMPT

Let's create a new Game using PyGame.
Use the context(GAME.md file) to understand what we will gonna build.
Plan first, Think step by step, think hard.

The response from Amazon Q was:

After some time waiting Amazon Q developing the game, I got the first working version of the game, with some issues that I ask it to solve, so iterate with my second prompt.

2 PROMPT

OK, I guess we are almost there, but we need to fix some things.

  1. The level is not visible, although I can see it, is kind inside the ghost image and the lvl is not easy to read.
  2. The IA ghosts are cheating, they kill me passing through the walls without respecting the maze walls.
  3. I was able to kill another ghost in the same level as me, If the ghosts are in the same level, both got killed.
  4. I would like the game looking and feel like the original classic PacMan with black background and blue walls like 1980 game.

After the second iteration, the ghosts are still cheating, but the speed was better.

3 PROMPT

ok, for some reason the ghosts are still cheating. I saw them ignoring the maze walls. Besides that, when they are 'cheating' the also increase their own speed at insane speed!
The speed should be equal at start, and only when a ghost level up it gots a little bit more speed, not much.
Also, I got the below error in the console(although the game is working)
:488: RuntimeWarning: Your system is avx2 capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation.
pygame 2.5.2 (SDL 2.30.0, Python 3.12.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
Could not load sound file: pickup.wav, error: RIFF form type is not WAVE (not a Waveform file)
Could not load sound file: elimination.wav, error: RIFF form type is not WAVE (not a Waveform file)

Now the ghost are better, but still cheating for some reason. I guess the machines find out its way to break the rules too. :D

But I'm satisfied with the current version of the game and perhaps I'll iterate more on the future and add some features.

That's all! Thank you!