Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/k3ury99/ai-powered-snake-game
The AI-Powered-Snake-Game offers two versions of Snake: a classic manual control version and an advanced AI-controlled version using A* pathfinding. Both versions feature customizable options and unique gameplay elements, providing diverse and challenging experiences.
https://github.com/k3ury99/ai-powered-snake-game
artificial-intelligence python3 snake-game
Last synced: 2 months ago
JSON representation
The AI-Powered-Snake-Game offers two versions of Snake: a classic manual control version and an advanced AI-controlled version using A* pathfinding. Both versions feature customizable options and unique gameplay elements, providing diverse and challenging experiences.
- Host: GitHub
- URL: https://github.com/k3ury99/ai-powered-snake-game
- Owner: K3ury99
- License: mit
- Created: 2024-08-06T00:30:20.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-19T01:09:34.000Z (5 months ago)
- Last Synced: 2024-08-19T02:29:08.506Z (5 months ago)
- Topics: artificial-intelligence, python3, snake-game
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ AI-Powered-Snake-Game
> [!NOTE]
The AI-Powered-Snake-Game is an engaging Python project featuring two versions of the classic Snake game using Pygame. The Normal Version offers traditional gameplay with manual controls, while the AI Version showcases a self-playing snake managed by an AI algorithm with A* pathfinding for optimal performance. Both versions include customizable features and unique gameplay elements, providing players with diverse and challenging experiences.
### This project contains two versions of the classic Snake game implemented in Python using Pygame:
1. **Normal Version**: A traditional Snake game with manual controls.
2. **AI Version**: An advanced version where the snake is controlled by an AI algorithm, making it more challenging and self-playing. It has this design so that the snake finds the fastest and safest route, making the snake survive for as long as possible, making it very difficult for it to die.## ๐ฎ Features
### Normal Version
- Classic Snake gameplay
- Manual control using arrow keys
- Customizable snake and food colors
- Game over screen with restart option
- Score tracking### AI Version
- Self-playing Snake controlled by AI
- A* pathfinding algorithm for optimal moves
- Ghost trail effect
- Wraparound screen edges
- Grid display for better visualization
- Game over and win conditions## ๐ ๏ธ Technologies Used
- Python
- Pygame
- A* Pathfinding Algorithm (AI Version)## ๐ Installation
1. Clone the repository:
2. Navigate to the project directory: cd ai-snake-game
3. Install the required dependencies: pip install pygame## ๐น๏ธ How to Play
### Normal Version
- Run the game: python snake_game.py- Use arrow keys to control the snake
- Eat food to grow and increase your score
- Avoid colliding with walls or the snake's body### AI Version
- Run the game: python ai_snake_game.py- Watch as the AI controls the snake to maximize its score
- The game ends when the snake fills the entire grid## ๐จ Customization
### ๐Normal Version
- Press 1-3 to change snake color
- Press 4-6 to change food color### ๐AI Version
- Adjust game speed in the `run()` method## ๐ค Contributing
Contributions, issues, and feature requests are welcome! Feel free to check [issues page](https://github.com/yourusername/ai-snake-game/issues).
## ๐ License
This project is [MIT](https://choosealicense.com/licenses/mit/) licensed.
## ๐จโ๐ป Author
- GitHub: https://github.com/K3ury99
- LinkedIn: https://www.linkedin.com/in/keury03/