- The snake starts at the center of the screen and moves in any direction using the 'w', 's', 'a', 'd' keys to move up, down, left, or right respectively.
- A food item appears randomly on the screen.
- The snake grows in length and the score increases each time the snake eats the food item.
- The game ends when the snake hits the boundary or collides with its own body.
- The game can be paused and unpaused by pressing the 'p' key.
The game can be paused and unpaused using the 'p' key. This lets you take a break without having to stop the game entirely.
The game includes sound effects to enhance the playing experience. When the snake eats a food item, an eating sound effect (eat.wav) plays. When the snake dies, a dying sound effect (die.wav) plays.
The game offers two difficulty levels: Easy and Hard. You can choose the difficulty level by clicking on the respective buttons on the screen. The difficulty level affects the speed of the snake, making the game more challenging on the Hard level.
- Fork the repo by clicking the fork logo the on top right
- Clone the repo
git clone [email protected]:AseanK/beginner-python-games.git
- Head to the snake_game folder
- Ensure that you have the required sound files (eat.wav and die.wav) in the
snake_game
directory. - Run the game using python command
python game.py