Skip to content

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.

Notifications You must be signed in to change notification settings

codebyimran-projects/Snake-game-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages