A modern, feature-rich implementation of the classic Snake game using Pygame, with configurable difficulty levels and smooth gameplay.
-
Easy Mode:
- Slower snake movement
- Larger game grid
- More forgiving wall collision (wrap-around)
- Longer initial snake length
-
Medium Mode:
- Standard snake movement speed
- Regular grid size
- Normal wall collision
- Standard initial snake length
-
Hard Mode:
- Faster snake movement
- Smaller game grid
- Strict wall collision
- Shorter initial snake length
- Classic Snake gameplay
- Dynamic food spawning
- Collision detection
- Real-time score tracking
- Intuitive menu system
- Create environment with conda
conda create -n snake pygame --yes
conda activate snake
- Clone the repository
git clone https://github.com/AhmedOsamaMath/snake-game.git
cd snake-game
- Run the game
python main.py
- UP/DOWN Arrows: Navigate menu options
- ENTER: Select/Start
- ESC: Return to previous menu
- Arrow Keys: Control snake direction
- R: Restart game (after game over)
- ESC: Return to main menu
main.py
: Main game entry pointgame_states.py
: Game state managementsettings.py
: Game configuration and difficulty settingsgame_manager.py
: Core game logic and rendering
Easily modify game parameters in settings.py
:
- Screen dimensions
- Color schemes
- Difficulty settings
This project is licensed under the MIT License. See the LICENSE file for details.