Skip to content

shuchijahan/Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Sure! Here's a README.md for your Snake game project that you can use on GitHub.

# Snake Game in Python

A simple implementation of the classic Snake game using Python and the `pygame` library. The game features a snake that grows longer each time it eats food, and the player must avoid hitting the walls or the snake's own body.

## Features

- Snake moves around the screen, and you control it using the arrow keys.
- Each time the snake eats food (yellow block), it grows longer.
- The game ends when the snake collides with the wall or its own body.
- After losing, you can choose to play again or quit the game.

## How to Play

- **Move the snake** using the arrow keys:
  - **Up** arrow key to move up.
  - **Down** arrow key to move down.
  - **Left** arrow key to move left.
  - **Right** arrow key to move right.
- **Eat the food** (yellow block) to grow the snake and increase your score.
- **Avoid walls** and **avoid running into the snake's body**.
- **Press Q** to quit the game after losing.
- **Press C** to restart the game after losing.

## Requirements

To play the game, you need Python installed, along with the `pygame` library.

### Install Python (if not already installed)

- Download and install Python from [python.org](https://www.python.org/downloads/).

### Install Pygame

To install `pygame`, run the following command:

```bash
pip install pygame

How to Run the Game

  1. Clone this repository:

    git clone https://github.com/shuchijahan/Snake-Game.git
    cd Snake-Game
  2. Run the Python script:

    python snake_game.py

    The game window will open, and you can start playing!

Game Controls

  • Arrow Keys: Control the snake's direction.
  • Q: Quit the game after losing.
  • C: Start a new game after losing.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • The game is built using the pygame library, which is a great tool for creating games with Python.
  • Special thanks to the open-source community for the support and resources!

Screenshot

Snake Game Screenshot


Enjoy playing the Snake game! 🐍

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages