Skip to content

madnessbrainsbl/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

markdown

Snake Game

A classic Snake game implemented in Python using the Pygame library with enhanced visual features.

Description

In this game, you control a snake that moves around a grid, eating food to grow longer. The objective is to achieve the highest score possible without crashing into the walls or the snake's own body.

Features

  • Intuitive controls using arrow keys
  • Score tracking displayed in a stylish header
  • Game over screen with restart option
  • Enhanced visuals:
    • Grid background for better spatial awareness
    • Snake with expressive eyes on its head
    • Circular red food instead of a square
    • Semi-transparent overlay on game over
    • Bordered game area and score header

Requirements

  • Python 3.x
  • Pygame library

Install Pygame using pip:

pip install pygame

How to Run

Ensure Python and Pygame are installed on your system.

Save the game code in a file, e.g., snake_game.py.

Run the game using Python:

python snake.py

Controls

Arrow Keys: Move the snake up, down, left, or right

R: Restart the game after "Game Over"

Gameplay

The snake starts with a length of 3 segments and moves automatically.

Eat the red circular food to grow longer and increase your score.

Avoid hitting the walls or the snake's own body to keep playing.

When the game ends, press 'R' to start over.

Enjoy the game!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages