A classic Snake game built using Python and Pygame. This game features exciting gameplay with special mango food, sound effects, and increasing difficulty as you progress.
- Classic Gameplay: Control the snake to eat apples and grow in size.
- Special Mango Food: Occasionally, a mango appears for 5 seconds. Eating it adds 3 points to your score and increases the snake's length.
- Dynamic Difficulty: The snake's speed increases every 5 points, making the game more challenging.
- Immersive Sound Effects: Background music and sound effects for eating food and game over.
- Top Score Tracking: Displays the current score and the top score.
Follow these steps to set up and run the game:
Clone the repository using the following command:
git clone https://github.com/AliJ-Official/SnakeGame.git
If you don't have Git installed, you can download the ZIP file from this link and extract it.
Create a virtual environment to isolate dependencies:
python -m venv .venv
Activate the virtual environment using the following command:
- On Windows:
.venv\Scripts\activate
- On macOS/Linux:
source .venv/bin/activate
Install the required dependencies using pip:
pip install pygame
Run the game using the following command:
python SnakeGame.py
To deactivate the virtual environment, use:
deactivate
Alternatively, you can run the game without activating the virtual environment:
.venv\Scripts\python.exe SnakeGame.py
- Do not go outside the snake's boundaries.
- Avoid colliding with the snake's own body.
- Every 5 points, the snake's speed increases.
- Mangoes are special food that appear for 5 seconds. Eating them adds 3 points to your score and increases the snake's length.
This project requires Python and the following Python package:
pygame==2.6.1
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy the game! 🎉