Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Snake Game

A classic Snake Game built using Python and the Turtle Graphics library. Control the snake, eat food to grow longer, beat your high score, and avoid crashing into the walls or your own tail.


🎮 Features

  • Classic Snake gameplay
  • Smooth movement using keyboard controls
  • Randomly spawning food
  • Score tracking
  • High score saved locally
  • Automatic game reset after collision
  • Clean object-oriented Python code

📂 Project Structure

Snake-Game/
│── main.py           # Main game loop
│── snake.py          # Snake class and movement logic
│── food.py           # Food generation
│── scoreboard.py     # Score and high score management
│── data.txt          # Stores the highest score
└── README.md

🛠️ Technologies Used

  • Python 3
  • Turtle Graphics
  • Object-Oriented Programming (OOP)

▶️ How to Run

  1. Clone the repository:
git clone https://github.com/your-username/snake-game.git
  1. Navigate to the project folder:
cd snake-game
  1. Run the game:
python main.py

Make sure Python 3 is installed. The Turtle module comes pre-installed with Python.


🎯 Controls

Key Action
Move Up
Move Down
Move Left
Move Right

🕹️ Gameplay

  • Eat the white food to increase your score.
  • Every food collected makes the snake grow longer.
  • Hitting the wall or your own tail resets the game.
  • Your highest score is automatically saved in data.txt.

📸 Screenshot

Screenshots of the game.

Application Screenshot 01

Application Screenshot 02


📚 Concepts Practiced

  • Classes and Objects
  • Inheritance
  • Event Handling
  • Collision Detection
  • File Handling
  • Game Loop
  • Turtle Graphics

🚀 Future Improvements

  • Sound effects
  • Pause and Resume feature
  • Difficulty levels
  • Obstacles
  • Start Menu
  • Better graphics and animations

🤝 Contributing

Contributions are welcome! Feel free to fork this repository, improve the game, and submit a pull request.


📄 License

This project is licensed under the MIT License.


⭐ If you enjoyed this project, consider giving it a star on GitHub!

About

Nostalgic snake game where you have to eat food which makes the snake longer and faster as game proceeds.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages