A competitive snake game where you face off against AI opponents. Choose your difficulty level and compete to collect food and grow your snake. Features normal and special food items, progressive difficulty, and wrapped screen edges.
Download compiled version and run locally: SnakePython.exe
- Python 3.x
- Pygame library
To install Pygame, run:
pip install pygame
- Save the game code as
SnakePython.py
- Open a terminal/command prompt
- Navigate to the game directory
- Run the command:
python SnakePython.py
- pip install pyinstaller
- pyinstaller --onefile SnakePython.py
- 🎯 Player vs AI gameplay with three difficulty levels:
- Easy: 1 AI opponent, win score of 15
- Medium: 2 AI opponents, win score of 20
- Hard: 3 AI opponents, win score of 25
- 🍎 Three types of food:
- Normal food (red) - Worth 1 point, grows snake by 4 segments
- Yellow food - Worth 1 point, grows snake by 4 segments
- Special food (gold) - Worth 2 points, grows snake by 8 segments
- ⚡ Dynamic difficulty: Game speed increases for every 5 food items collected
- 🌐 Wrapped screen edges (toroidal playing field)
- 📊 Score tracking for all players
- 🖥️ Full-screen display
- Arrow Keys: Control player snake direction
- ↑: Move Up
- ↓: Move Down
- ←: Move Left
- →: Move Right
- ESC: Quit game
- Enter: Restart game after game over
- 1, 2, 3: Select difficulty level at start
- 🎯 Control your snake (green with yellow head) to collect food
⚠️ Avoid collisions with:- Your own body
- The AI snakes (blue with purple heads)
- The AI snakes' heads (head-to-head collision results in a tie)
- 🏆 First to reach the win score for your difficulty wins:
- Easy: 15 points
- Medium: 20 points
- Hard: 25 points
- 💥 Game ends if any snake:
- Collides with itself
- Collides with an opponent
- Reaches the winning score
- 🔴 Normal Food (Red): 1 point
- 🟡 Yellow Food: 1 point
- 🌟 Special Food (Gold): 2 points
The game ends when:
- 🏅 Any player reaches the win score for the chosen difficulty
- 💥 A snake collides with itself or an opponent
- ⚔️ Snakes collide head-on (results in a tie)
- 🚫 A snake has no valid moves remaining
Press Enter to restart the game after it ends or ESC to exit! 🎮
Built with ChatGPT o3-mini-high and Claude Sonnet 3.5