A complete Snake Game project built using Python and Pygame, featuring both manual gameplay and AI-powered automation. This project demonstrates game development, logic building, and AI-based problem solving.
- Control snake using arrow keys
- Real-time movement and collision detection
- Score tracking system
- Game over on wall or self collision
- Automated snake movement using intelligent algorithms
- Supports:
- Greedy Algorithm
- Hamiltonian Path Algorithm
- Demonstrates AI decision-making concepts
- Python 🐍
- Pygame 🎮
- Basic AI Algorithms 🤖
AI-SNAKE-GAME/
│
├── snake/
├── logs/
│
├── AI_SnakeGame.py
├── Manual_SnakeGame.py
│
├── requirements.txt
└── README.md
-
Clone the repository: git clone https://github.com/selvan-01/AI-Snake-Game.git
-
Navigate to project folder: cd AI-Snake-Game
-
Install dependencies: pip install -r requirements.txt
Run Manual Snake Game: python Manual_SnakeGame.py
Run AI Snake Game: python AI_SnakeGame.py
↑ Arrow - Move Up
↓ Arrow - Move Down
← Arrow - Move Left
→ Arrow - Move Right
Greedy Solver:
- Fast decision making
- Moves directly towards food
- May fail in complex situations
Hamiltonian Solver:
- Follows a fixed safe path
- Ensures longer survival
- Slower but reliable
- Game development using Pygame
- Event handling and rendering
- Collision detection logic
- AI pathfinding basics
- Clean code structuring
- Add difficulty levels
- Implement Reinforcement Learning
- Add sound effects and UI improvements
- Leaderboard system
S. Senthamil Selvan (Sen)
Aspiring Data Analyst | AI Developer
If you like this project:
- Star the repository
- Share with others
- Connect on LinkedIn
This project is open-source and created for learning purposes.