Skip to content

A modern, customizable Snake game implemented in Python using Pygame. Features multiple difficulty levels, intuitive UI, and smooth gameplay mechanics. Perfect for learning game development and Python programming.

License

Notifications You must be signed in to change notification settings

AhmedOsamaMath/snake-game

Repository files navigation

Snake Game 🐍

A modern, feature-rich implementation of the classic Snake game using Pygame, with configurable difficulty levels and smooth gameplay.

Python Versions Pygame License Game Version

Screenshot

🎮 Game Features

Difficulty Levels

  • Easy Mode:

    • Slower snake movement
    • Larger game grid
    • More forgiving wall collision (wrap-around)
    • Longer initial snake length
  • Medium Mode:

    • Standard snake movement speed
    • Regular grid size
    • Normal wall collision
    • Standard initial snake length
  • Hard Mode:

    • Faster snake movement
    • Smaller game grid
    • Strict wall collision
    • Shorter initial snake length

Game Mechanics

  • Classic Snake gameplay
  • Dynamic food spawning
  • Collision detection
  • Real-time score tracking
  • Intuitive menu system

🚀 How to Run

  1. Create environment with conda
conda create -n snake pygame --yes
conda activate snake
  1. Clone the repository
git clone https://github.com/AhmedOsamaMath/snake-game.git
cd snake-game
  1. Run the game
python main.py

🎮 Controls

Menu Navigation

  • UP/DOWN Arrows: Navigate menu options
  • ENTER: Select/Start
  • ESC: Return to previous menu

Gameplay

  • Arrow Keys: Control snake direction
  • R: Restart game (after game over)
  • ESC: Return to main menu

📦 Project Structure

  • main.py: Main game entry point
  • game_states.py: Game state management
  • settings.py: Game configuration and difficulty settings
  • game_manager.py: Core game logic and rendering

🔧 Customization

Easily modify game parameters in settings.py:

  • Screen dimensions
  • Color schemes
  • Difficulty settings

📝 License

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

About

A modern, customizable Snake game implemented in Python using Pygame. Features multiple difficulty levels, intuitive UI, and smooth gameplay mechanics. Perfect for learning game development and Python programming.

Topics

Resources

License

Stars

Watchers

Forks

Languages