/Snake-Game

This repository contains an implementation of the classic Snake Game using Python and the Turtle graphics library. Control a snake, navigate it to eat food, and watch it grow while avoiding collisions with walls and its own body.

Primary LanguagePythonMIT LicenseMIT

Snake Game

This repository contains an implementation of the classic Snake Game using Python and the Turtle graphics library. Control a snake, navigate it to eat food, and watch it grow while avoiding collisions with walls and its own body.

How to Run the Game:

  1. Clone the repository: git clone https://github.com/Rehab-Adel/snake-game.git
  2. Open the project in your preferred Python IDE (e.g., PyCharm).
  3. Make sure you have the required Python libraries installed: Turtle, Time, and Random.
  4. Run the Snake-Game.py file.
  5. Enjoy playing the Snake Game!

Python Libraries Used:

  • Turtle - A graphics library for Python that provides a simple and intuitive way to create graphics and animations.
  • Time - A Python module that provides various time-related functions, including time delay in the game loop.
  • Random - A Python module that offers functions for generating pseudo-random numbers, used for generating food positions in the game.

Game Controls:

Use the W, S, A, and D keys on your keyboard to control the snake's direction (up, down, left, right). The game will end if the snake collides with the wall or its own body.

Features:

  • Play the classic Snake Game with intuitive controls.
  • Utilizes the Turtle graphics library for smooth animations and graphics rendering.
  • Random food generation for an ever-changing gameplay experience.
  • Game over when the snake collides with the wall or its own body.
  • Score tracking and display on the screen.
  • High score tracking and updating.

Resources:

  • Python Documentation - Comprehensive documentation on the Python standard library, including the libraries used in this game.
  • Turtle Graphics Tutorial - A tutorial provided in the Python documentation specifically for the Turtle graphics library.

Contact:

Feel free to reach out to me if you have any questions or suggestions. You can find my contact information on my LinkedIn.