Skip to content

This project is a modern reinterpretation of the classic Snake game, developed in Python with the Pygame library. The game features a snake that grows in length as it eats food and the challenge is to control the snake in such a way that it doesn't collide with itself or the walls.

Notifications You must be signed in to change notification settings

chhaviiiii/Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Snake Game in Python

Description

This Simple Snake Game is a basic implementation of the classic Snake game using Python and Pygame. The player controls a snake, which moves around the game area, eating food to grow longer. The game ends if the snake runs into the game area walls or into itself.

Features

  • Basic snake movement and growth mechanics
  • Collision detection with food, walls, and the snake's body
  • Score tracking based on the length of the snake
  • Customizable game area and snake speed
  • Graphical display using Pygame, including images for snake's head, food, and background

Requirements

  • Python 3.x
  • Pygame library

Installation

  1. Ensure Python 3.x is installed on your system.
  2. Install Pygame:
    pip install pygame
    
  3. Download the game source code and the required image files:

How to Play

  1. Run the script:
    python snake_game.py
    
  2. Use the arrow keys to control the movement of the snake.
  3. Eat the food to grow longer.
  4. Avoid hitting the walls or the snake's body.
  5. The game ends when the snake collides with the wall or itself. Press R to restart or Q to quit.

Game Controls

  • Arrow keys: Move the snake (Up, Down, Left, Right)
  • Q: Quit the game
  • R: Restart the game

Customization

  • Change snake_speed to adjust the speed of the snake.
  • Modify width and height to change the size of the game area.
  • Replace image files to customize the appearance.

Contribution

Contributions to the game are welcome. Please feel free to fork the repository, make improvements, and open a pull request.

Acknowledgements

  • Pygame Community for the excellent game development library
  • Original creators of the Snake game for inspiration

About

This project is a modern reinterpretation of the classic Snake game, developed in Python with the Pygame library. The game features a snake that grows in length as it eats food and the challenge is to control the snake in such a way that it doesn't collide with itself or the walls.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages