A Python project for running Game Boy games using PyBoy emulator. This project is set up to play Tetris on the Game Boy emulator.
- Python 3.8 or higher
- macOS (tested on Apple Silicon M1)
- Game Boy ROM files (not included in this repository)
- Clone the repository:
git clone https://github.com/yourusername/ai_plays_pyboy.git
cd ai_plays_pyboy- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On macOS/Linux- Install dependencies:
pip install -r requirements.txt- Add your Game Boy ROM files to the project directory:
- Place your ROM files (e.g.,
tetris.gb) in the project root - Note: ROM files are not included in this repository due to copyright restrictions
- Place your ROM files (e.g.,
To play Tetris:
python3 play_tetris.py- Arrow Keys: Move piece left/right
- Up Arrow: Rotate piece
- Down Arrow: Drop piece faster
- Space: Drop piece instantly
- Escape: Quit game
Additional PyBoy controls:
- F11: Toggle fullscreen
- D: Debug mode
- Z: Save state
- X: Load state
- I: Toggle screen recording
- O: Save screenshot
play_tetris.py: Main script to run the gamerequirements.txt: Python dependencies*.gb: Game Boy ROM files (not included)*.ram: Save state files (generated automatically)
This project is licensed under the MIT License - see the LICENSE file for details.
- PyBoy - Game Boy emulator
- Nintendo - Tetris (Game Boy version)