← All work

Feature·chetannihith/proj-hacktoberfest25

Add a Pygame snake game with gameplay documentation

Introduces a snake-game project with a Pygame display, segment rendering, randomized apple coordinates, and game-over controls. A README describes gameplay, dependencies, and launch instructions.

The problem

This addition provides a standalone snake-game project for the repository. Its implementation needs graphical rendering, game-state initialization, event handling, and a way to restart or exit after game over.

The approach

The script initializes an 800×600 Pygame window and represents the snake as a list of segments drawn as rectangles. The game loop initializes position, movement deltas, length, and randomized apple coordinates, while the visible game-over handler supports quitting or restarting by calling gameLoop again. The README documents arrow-key movement, apple consumption, collision rules, and Pygame installation.

What changed

Adds Slither.io/sithergame.py and a README. The visible code establishes rendering and game-state scaffolding with restart and quit handling; the truncated diff does not expose the full movement or collision implementation. The README's launch command references snake_game.py rather than the added script.

  • python
  • pygame
  • snake-game
  • event-loop