Skip to content

ShravaniRanshevare/CatchTheSnake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CatchTheSnake

Snake Game ๐Ÿ is a simple arcade-style game built in Python using the Pygame library. The player controls a snake that moves around the screen, eating food to grow longer while avoiding collisions with walls or itself. The game includes scoring and sound effects making it a fun way to practice Python game development and event handling. A classic Snake Game built with Python and Pygame.
Control the snake, eat food, grow longer, and avoid collisions with walls or yourself. Simple, fun, and addictive!


๐ŸŽฎ Features

  • Snake movement: Navigate using arrow keys (Up, Down, Left, Right).
  • Food spawning: Randomly placed red blocks appear on the screen.
  • Scoring system: Gain +10 points each time the snake eats food.
  • Collision detection: Game ends if the snake hits the wall or itself.
  • Restart/Quit option: Press Q to quit the game gracefully.
  • Sound effect: Plays a ping sound when food is eaten (macOS default sound).

๐Ÿ› ๏ธ Requirements

  • Python 3.x
  • Pygame library

Install dependencies:

pip install pygame

โ–ถ๏ธ How to Run

    1. Clone or download repository
    1. Save script as snake_game.py
    1. Run the game:
    1. python snake_game.py

๐ŸŽฏ Controls

    • Arrow Keys: Move the snake in the desired direction.
    • Q Key: Quit the game after a short delay.

๐Ÿ“Š Scoring

    • +10 points per food
    • Highest score tracked

๐Ÿ–ผ๏ธ Game Design

    • Snake: Green blocks that grow longer when food is eaten.
    • Food: Red block randomly placed on the grid.
    • Background: Yellow screen for contrast.

๐Ÿš€ Future Improvements

    • Levels or increasing speed
    • Persistent high scores
    • Custom sound effects/themes

๐Ÿ“Œ Notes

    • The sound effect uses afplay (macOS). On other systems, replace with a suitable audio player or Pygameโ€™s mixer module.
    • Ensure your terminal/IDE supports running Pygame windows.

About

Snake Game ๐Ÿ is a simple arcade-style game built in Python using the Pygame library. The player controls a snake that moves around the screen, eating food to grow longer while avoiding collisions with walls or itself. The game includes scoring and sound effects making it a fun way to practice Python game development and event handling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages