Skip to content

A classic implementation of the popular Snake game using Python's Turtle graphics module. Control the snake, eat food, and avoid collisions to achieve a high score.

Notifications You must be signed in to change notification settings

sMarekus/snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

A classic implementation of the popular Snake game using Python's Turtle graphics module. Control the snake, eat food, and avoid collisions to achieve a high score.

How to Play

  1. Use the arrow keys to control the snake's movement: up, down, left, and right.
  2. The snake will move continuously in the direction it is facing.
  3. Guide the snake to eat the food represented by a blue circle.
  4. Each time the snake eats the food, it grows longer, and your score increases.
  5. Be careful not to collide with the walls or the snake's own body.
  6. The game ends when the snake hits a wall or itself.
  7. Aim for a high score and enjoy the game!

Files

  • food.py: Contains the Food class, responsible for managing the food object in the game.
  • snake.py: Defines the Snake class, which represents the snake and handles its movement and control.
  • score.py: Implements the Score class, responsible for displaying and updating the player's score.
  • main.py: The main script that brings all the components together and runs the game.

Requirements

  • Python 3.x
  • Turtle graphics module (usually comes pre-installed with Python)

Usage

  1. Install Python on your system if you haven't already.
  2. Clone this repository or download the project files.
  3. Open a terminal and navigate to the project directory.
  4. Run the following command to start the game:
    python main.py

About

A classic implementation of the popular Snake game using Python's Turtle graphics module. Control the snake, eat food, and avoid collisions to achieve a high score.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages