Skip to content

karansingh-in/Classic-Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ Classic Snake Game

A nostalgic recreation of the iconic Snake game built with Python and Turtle graphics. Relive the retro gaming experience with smooth controls, custom graphics, and an addictive gameplay loop!

Python License Platform

๐ŸŽฎ Features

  • Classic Gameplay: Navigate the snake using arrow keys to collect food and grow longer
  • Custom Graphics: Retro-styled snake head and vibrant background for an authentic experience
  • Score Tracking: Keep track of your current score as you play
  • Collision Detection: Game ends when the snake hits the wall or its own body
  • Smooth Controls: Responsive keyboard input for seamless gameplay

๐Ÿ“ธ Screenshot

Snake Game Screenshot

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.x installed on your system
  • No additional libraries required (uses built-in turtle module)

Installation

  1. Clone the repository:
git clone https://github.com/karansingh-in/Classic-Snake-Game.git
cd Classic-Snake-Game
  1. Run the game:
python main.py

That's it! The game will launch immediately.

๐ŸŽฏ How to Play

  1. Start the game by running main.py
  2. Control the snake using WASD or arrow keys:
    • W or โฌ†๏ธ Up Arrow - Move up
    • S or โฌ‡๏ธ Down Arrow - Move down
    • A or โฌ…๏ธ Left Arrow - Move left
    • D or โžก๏ธ Right Arrow - Move right
  3. Eat the food (red circles) to grow longer and increase your score
  4. Avoid hitting:
    • The walls (screen boundaries)
    • Your own snake body
  5. Try to beat your high score!

๐Ÿ“ Project Structure

Classic-Snake-Game/
โ”‚
โ”œโ”€โ”€ main.py              # Main game loop and setup
โ”œโ”€โ”€ snake.py             # Snake class with movement logic
โ”œโ”€โ”€ food.py              # Food class for spawning items
โ”œโ”€โ”€ background.gif       # Game background image
โ”œโ”€โ”€ snake-head.gif       # Custom snake head sprite
โ””โ”€โ”€ icon.ico             # Game window icon

๐Ÿ› ๏ธ Building Executables

Want to create a standalone executable? Use PyInstaller!

For Windows:

pip install pyinstaller
pyinstaller main.spec

For Linux/macOS:

See the platform-specific .spec files in the repository.

๐Ÿค Contributing

Contributions are welcome! Here are some ideas:

  • Add difficulty levels (speed variations)
  • Implement a high score system with persistent storage
  • Add sound effects and background music
  • Create power-ups (speed boost, invincibility, etc.)
  • Add a pause function
  • Implement a menu system

To contribute:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by the original Snake game from Nokia phones
  • Built with Python's Turtle graphics module
  • Thanks to the Python community for excellent documentation

๐Ÿ“ง Contact

Karan Singh - @karansingh-in

Project Link: https://github.com/karansingh-in/Classic-Snake-Game


โญ Star this repo if you enjoyed the game!

About

๐Ÿ A nostalgic recreation of the classic Snake game built with Python and Turtle graphics. Control the snake, eat food, and watch your score growโ€”just don't hit the walls or yourself!

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages