Skip to content

Tisma09/ai-tetris-player

Repository files navigation

🎮 Tetris with Deep Q-Learning

en fr

An AI-powered Tetris implementation that learns to play by itself!

Python 3.8+ PyTorch


🚀 Overview

This project combines Tetris with Deep Q-Learning, creating an AI that learns to play the game through reinforcement learning.

✨ Features

  • 🎮 Tetris game built with Pygame
  • 🧠 Deep Q-Learning implementation
  • 🚀 Multi-process training
  • 💾 Save/Load AI models

🛠️ Installation

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install requirements
pip install -r requirements.txt

🎯 How to Use

Start the program:

python main.py

Then:

  • Type 'y' to train a new AI
  • Type 'n' to watch the trained AI play

📁 Project Structure

├── main.py           # Entry point
├── tetris_game.py    # Game implementation
├── dql_agent.py      # AI agent
├── train.py          # Training functions
├── tetris_env.py     # Gym environment
├── config.py         # Game settings
└── plot_scores.py    # Training graphs

Contributors

👤 @Tismo
👤 @Alexis
👤 @J0lataupe

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages