Skip to content

rvqzs/snake_game

Repository files navigation

Snake Game

A simple implementation of the classic Snake Game using the Turtle module from Python. The game features a snake that grows as it eats food, and the player must avoid colliding with the walls or the snake itself. Inspired by the classic arcade game.

snake_game

Features

  • Simple gameplay
  • Basic scoring system

Installation

  1. Download the Project Files

    • Download the ZIP file of the project from this link.
  2. Extract the ZIP File

    • After downloading, extract the ZIP file to a directory of your choice. This will create a folder named snake_game-master containing the project files.
  3. Check Python Installation

    • To check if Python is installed on your system, open a terminal or command prompt and run:
      python --version
    • If Python is not installed, download and install Python from python.org. Ensure you download Python version 3.11.8 or above.
  4. Install Turtle Module

    • The Turtle module is included with most Python distributions. If it's not installed, you can install it via pip:
      pip install PythonTurtle

Usage

  1. Open Terminal or PowerShell

    • On Windows, you can open Command Prompt or PowerShell by pressing Win + R, typing cmd or powershell, and pressing Enter.
  2. Navigate to the Project Directory

    • Use the cd command to change to the directory where you extracted the ZIP file. For example, if you extracted the files to C:\Users\username\Downloads\snake_game-master, you would run:
      cd C:\Users\username\Downloads\snake_game-master
  3. Run the Game

    • Start the game by running the following command:
      python main.py
    • If you encounter issues, try:
      py main.py
  4. Start Playing

    • Use the arrow keys to control the direction of the snake.
    • Eat the food (represented by a circle) to grow the snake and increase your score.
    • Avoid colliding with the walls or the snake's own body.
    • The game ends when the snake collides with itself or the boundaries.

License

This project is licensed under the Unlicense License. See the UNLICENSE file.