This classic game is built using the Pygame library and offers a fun and addictive gameplay experience.
- Use the arrow keys or WASD keys to control the snake's movement.
- Guide the snake to eat the red food dots to grow longer.
- Avoid colliding with the boundaries or the snake's own body.
- The game ends when the snake collides with a boundary or its own body.
- Move Left: Arrow Left or A
- Move Right: Arrow Right or D
- Move Up: Arrow Up or W
- Move Down: Arrow Down or S
To run the Snake Game, make sure you have Python installed along with the required dependencies listed in the requirements.txt
file.
-
Clone the project repository:
git clone https://github.com/nguyenttleo/SnakeGame.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the game:
python main.py
Enjoy playing the Snake Game! Try to achieve the highest score by growing the snake as long as possible without colliding. Good luck!
The following dependencies are required to run the Snake Game:
- pygame
You can install the required dependencies by running:
pip install -r requirements.txt
Please ensure that you have the necessary dependencies installed before running the game.
Note: The game screen size is set to 800x600 pixels by default. You can modify the screen_height
and screen_width
variables in the code to adjust the game window size according to your preference.
Have fun and enjoy the game! 🎮