https://github.com/bermudi/ai-python-games
Collection of games using pygame generated by AIs to test their capabilities.
https://github.com/bermudi/ai-python-games
Last synced: 16 days ago
JSON representation
Collection of games using pygame generated by AIs to test their capabilities.
- Host: GitHub
- URL: https://github.com/bermudi/ai-python-games
- Owner: bermudi
- Created: 2025-02-20T21:29:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-06T04:02:27.000Z (6 months ago)
- Last Synced: 2025-12-08T11:34:55.089Z (6 months ago)
- Language: Python
- Size: 384 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI-Generated Pygame Games Collection
This repository is a collection of games built using Pygame that were generated by various AIs to test their creative and technical capabilities. The projects span several genres—from simple physics experiments to classic Tetris variants and even a tower defense game. Each game file represents a unique iteration or idea, reflecting different approaches, experimental features, and creative twists from AI-generated code.
---
## Repository Structure
- **hexagon/**
Contains experiments involving a bouncing ball interacting with a rotating hexagon.
- **tetris/**
A collection of Tetris game variants that explore different implementations of the falling blocks game—from early experimental versions to more polished and feature-rich adaptations.
- **tower-defense/**
An advanced tower defense game that combines sprite generation, AI pathfinding using a simple A* algorithm, dynamic tower upgrades, and synergy mechanics.
---
## Game Descriptions and Comments
### Hexagon Games
- **`hexagon/gemini-2.0-flash-thinking-exp-01-21.py`**
*Description:* A simple experiment featuring a bouncing ball inside a rotating hexagon.
*Notes:*
- Implements gravity, friction, and basic collision detection against the hexagonal boundaries.
- Demonstrates fundamental physics simulation using Pygame routines.
- **`hexagon/gemini-2.0-pro-exp-02-05.py`**
*Description:* An advanced version of the bouncing ball game within a hexagon.
*Notes:*
- Refactored to use classes (e.g., a Hexagon class and a Ball class) for improved structure.
- Improved collision detection and added more polished movement and rotation handling.
- **`hexagon/gemini-2.0-pro-exp-02-05-poe.py`**
*Description:* A variant of the pro hexagon game with modified parameters.
*Notes:*
- Similar in design and functionality to the previous file but with different bounce damping values and parameter tweaks, possibly reflecting experiment variations from another AI system.
### Tetris Games
- **`tetris/gemini-2.0-flash-thinking-exp-01-21.py`**
*Description:* An early Tetris experimental build.
*Notes:*
- Initially encountered issues such as missing gravity and index errors.
- Served as an early attempt to generate a playable Tetris variant through iterative AI design.
- **`tetris/deepseek-r1.py`**
*Description:* A refined Tetris game featuring a clean, object-oriented approach.
*Notes:*
- Implements game elements like grid creation, piece rotation, collision detection, and line clearing.
- Showcases improved logic and gameplay mechanics compared to earlier experiments.
- **`tetris/4o.py`**
*Description:* A streamlined Tetris variant with a focus on simplicity.
*Notes:*
- Emphasizes colored blocks and basic score tracking.
- Provides a straightforward implementation ideal for quick demos or learning purposes.
- **`tetris/o1.py`**
*Description:* A minimalistic Tetris implementation.
*Notes:*
- Uses basic Pygame drawing functions and event handling for rotation and movement.
- Demonstrates a lean and functional gameplay loop.
- **`tetris/o3-mini-high.py`**
*Description:* An optimized version of Tetris with enhanced dynamic gameplay.
*Notes:*
- Offers improved handling of piece rotations, grid collisions, and scoring.
- Represents a more responsive and refined user experience.
- **`tetris/qwq-32b.py`**
*Description:* A Tetris game built with combined insights from different AI models.
*Notes:*
- Integrates creative ideas from systems like Sonnet 3.5 and Chain-of-Thought reasoning.
- Blends multiple design strategies to produce a novel gameplay experience.
- **`tetris/qwen-2.5-max.py`**
*Description:* A robust Tetris variant aimed at enhanced polish and extra features.
*Notes:*
- Contains multiple rotation methods and an overall more polished look.
- Demonstrates how iterative AI refinement can lead to superior game mechanics.
- **`tetris/claude-3.5-sonnet.py`**
*Description:* A stylish Tetris implementation reflecting the influence of AI models like Claude and Sonnet.
*Notes:*
- Features distinctive visuals and refined scoring systems.
- Stands out for its focus on aesthetic presentation and gameplay feel.
- **`tetris/grok3.py`**
*Description:* Another Tetris variant concentrating on effective grid management and piece generation.
*Notes:*
- Emphasizes reliable collision detection and a straightforward scoring mechanism.
- Acts as a solid example of classic Tetris logic implemented by AI.
### Tower Defense Game
- **`tower-defense/towerdefense_o3-mini-high.py`**
*Description:* An advanced tower defense game showcasing multiple AI-generated concepts.
*Notes:*
- Uses PIL for dynamic sprite generation and caching, offering unique tower and enemy visuals.
- Employs an A* pathfinding algorithm for enemy movement and demonstrates complex tower mechanics including upgrades, targeting strategies, and synergy effects among towers.
- A comprehensive project that highlights the potential of AI-generated code in creating multifaceted game simulations.
---
## How to Run
1. **Prerequisites:**
- Python 3.x
- [Pygame](https://www.pygame.org/)
- [Pillow](https://python-pillow.org/) (required for the tower defense game)
2. **Installation:**
Install the required libraries using `pip`:
```bash
pip install pygame pillow