DEV Community

Maxwell Dave Gazo
Maxwell Dave Gazo

Posted on

Glitch Runner: A Platformer Game with Dynamic Glitch Mechanics Made with Amazon Q CLI

⚠️ Disclaimer: This project was developed using a prompt-driven, vibe-coding approach via Amazon Q CLI. This approach is not recommended for production-grade systems without thorough understanding of the underlying code generated by your prompts. All generated output should be reviewed, tested, and validated for correctness and security.

Try Glitch Runner now:
https://github.com/maksdeb-g/Glitch-Runner

The Idea Behind Glitch Runner

Glitch Runner is a 2D platformer game created using Python, Pygame and Amazon Q CLI. I decided to use this idea because the concept of controlled chaos might give another twist to traditional platformer games. In Glitch Runner, the "glitches" are random and require the player to adjust to a new situation every few seconds.

Every effect changes the difficulty the game plays and can turn the precision platforming into a creative way of parkouring through the glitches. It seemed to be the ideal setting that would test the abilities of Amazon Q to manage both game-logic and rich visuals.

Prompting Techniques

I started with prompting the description of the game, giving the Q the concepts and the mechanics that I wanted.

I'm building a 2D platformer called Glitch Runner where the core mechanic is random real-time glitches affecting gameplay.
Enter fullscreen mode Exit fullscreen mode

Break Features into Smaller Tasks

I asked Q to create features one-by-one to increase its efficiency in creating the logic behind those features.

Help me implement reversed gravity in my player class.
Enter fullscreen mode Exit fullscreen mode
I want you to implement a glitch that shakes the user screen and also the platforms
Enter fullscreen mode Exit fullscreen mode

Iteration with Feedback

Once the features where working, I asked Q to improve them and provided my insights on what to improve.

The pixelation glitch feels like nothing has changed. Can you increase the distortion so it's more noticeable?
Enter fullscreen mode Exit fullscreen mode
The background is too visually distracting. Can you make it simpler while keeping the difficulty intact?
Enter fullscreen mode Exit fullscreen mode

Debugging using Problem-Solution Format

When I'm trying Q to fix a bug, I first laid out what was wrong and what I am expecting to be the result.

During reversed gravity glitch, the character floats out of the screen and doesn’t return. Can you fix that by putting screen boundaries?
Enter fullscreen mode Exit fullscreen mode

How Amazon Q Handled Classic Programming Challenges

Amazon Q did a great job in developing this whole game by doing all these tasks:

  • Modularity: Q helped in breaking down the play classes, game loops, and glitch engines into reusable modules.

  • Input Handling: The glitches comes with altered inputs for the users, Q did a great job in syncing the supposed inputs with their respective glitches.

Prompts That Saved Time

Basically, Amazon Q saved me from creating a project too long. However, there were notable prompts there that were more complicated than the other logics.

  • Sprite Animation States: laid out expected animation folders for idle, run, jump, fall, and wall slide, saving me the trouble of guessing file structure.
  • Audio and event wiring: With a single prompt, Q hooked up sound effects to player death, win conditions, and glitch events.

But the most surprising automation came when I tested PyInstaller and accidentally built an old version of the game. I asked Q to run the updated version directly and it executed the script from my directory like a local assistant. This deeply integrated behavior highlighted how Q goes beyond code generation to support full project workflows.

Examples of Smart AI-Generated Solutions

Screen Shake Glitch

def screen_shake(self, activate):
   if activate:
     self.shake_amount = random.randint(5, 15)
   else:
     self.shake_amount = 0
     self.screen_offset = (0, 0)

def update_screen_shake(self):
   if self.shake_amount > 0:
       self.screen_offset = (
         random.randint(-self.shake_amount, self.shake_amount),
         random.randint(-self.shake_amount, self.shake_amount)
    )
Enter fullscreen mode Exit fullscreen mode

Gravity Reversal Glitch

def reversed_gravity(self, activate):
    if activate:        
       self.game.player.velocity_y = -self.game.player.velocity_y 
       self.game.player.gravity = -self.original_gravity           
       self.game.player.ceiling_enabled = True
   else:
        # Restore normal gravity
        self.game.player.velocity_y = -self.game.player.velocity_y  # Immediate direction change
       self.game.player.gravity = self.original_gravity
       self.game.player.ceiling_enabled = False
Enter fullscreen mode Exit fullscreen mode

Final Gameplay and Screenshots

Image description

Image description

Image description

Conclusion

The development of Glitch Runner using Amazon Q was a great example of how the present-day AI can be directly beneficial to the entire process of game creation.

Q was also useful in the brainstorming of features, bug fixing, organization of my assets, and even running scripts. Even the design of the glitch system; features that thrive on randomness was shaped by the constraints of a prompt-driven development process, making its unpredictability a natural outcome of how the game was built.

This shows that our limited thoughts could, with the proper prompts, turn into a full-fledged game based on your imagination.

Top comments (0)