Skip to content

Shubhi0406/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

The Snake Game project recreates the well-known Snake arcade game using the Turtle graphics library in Python. Players control a snake that moves around the screen and grows longer as it consumes food. The objective is to collect as much food as possible without colliding with the walls or the snake's own body.

How to Play

  1. Run the main.py script to start the Snake Game.
  2. Use the arrow keys ("Up", "Down", "Left", "Right") to control the snake's movement.
  3. Guide the snake to eat the blue food dots that appear on the screen.
  4. Each time the snake consumes food, it grows longer.
  5. Colliding with the walls or the snake's own body ends the game.

Features

  • Classic Snake gameplay with user-controlled movement.
  • Snake and food items are implemented using the Turtle graphics library.
  • Scoreboard keeps track of the player's score and high score.
  • Food items are randomly placed on the screen for variety.

Files

  • main.py: The main Python script to run the Snake Game.
  • snake.py: Contains the Snake class to create and control the snake's behavior.
  • food.py: Contains the Food class to generate and refresh food items.
  • score.py: Contains the Scoreboard class to track and display scores.
  • data.txt: A text file to store the high score.

About

Snake Game in Python using Turtle library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages