Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 1.36 KB

File metadata and controls

70 lines (47 loc) · 1.36 KB

Snake Game Python

This is a classic Snake game built using Python’s turtle module. The player controls a snake that grows longer as it eats food, while trying to avoid collisions with boundaries and its own body. The game tracks the current score and the high score across plays.


Features

  • Smooth snake movement with keyboard control
  • Random food spawning
  • Snake body grows when food is eaten
  • Score and high score tracking
  • Collision detection for walls and self
  • Simple start and exit controls
  • Clean and responsive UI

Controls

  • Start Game: Press P
  • Exit Game: Press E
  • Move Snake:
    • Up: W
    • Down: S
    • Left: A
    • Right: D

Technologies

  • Python 3.x
  • turtle graphics
  • Standard libraries: time, random

How to Run

  1. Clone the repository:
git clone https://github.com/codebyimran-projects/Snake-game-python.git
  1. Navigate to the project folder:
cd Snake-game-python
  1. Run the game:
python main.py

Gameplay

The objective of the game is to eat as many pieces of food as possible without hitting the walls of the game window or the snake’s own body. The snake gets longer with each piece of food eaten, increasing the difficulty.


Who Made It

Made by: codebyimran

Repository:
https://github.com/codebyimran-projects/Snake-game-python