-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Readme
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
# Snake Game 🎮 | ||
|
||
## 🎯 Objective | ||
|
||
Here’s a more elaborate game called "Snake Game" using Python's `pygame` library. In this game, you control a snake that grows longer every time it eats food, and you have to avoid crashing into the walls or the snake's own body. | ||
|
||
--- | ||
|
||
**Prerequisite**:Install `pygame` | ||
|
||
Before running the code, you need to install the `pygame` library by running the following command: | ||
|
||
```bash | ||
pip install pygame | ||
``` | ||
--- | ||
|
||
## 🚀 How to Play: | ||
|
||
- Use arrow keys to move the snake (Up, Down, Left, Right). | ||
- Eat the red food blocks to grow the snake. | ||
- Avoid hitting the walls or running into the snake's body, or the game will be over. | ||
|
||
--- | ||
|
||
## 🔧 How to Run | ||
|
||
1. Clone the repository and navigate to the project folder: | ||
```bash | ||
git clone <repository-url> | ||
cd <project-folder> | ||
``` | ||
|
||
2. Install dependencies (if any) and then run the program: | ||
```bash | ||
python3 Snake.py | ||
``` | ||
|
||
3. Enjoy playing the Snake game! | ||
|
||
--- |