Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 2.18 KB

README.md

File metadata and controls

54 lines (41 loc) · 2.18 KB

Snake Game Using Pygame

This is a classic Snake Game implemented in Python using the Pygame library. The objective of the game is to control the snake and collect food to grow longer while avoiding collisions with the walls or itself.

Features

  • Move the snake using arrow keys or WASD.
  • Eat food to grow longer and score points.
  • Game over screen with the option to play again or quit.
  • Simple UI with buttons to start, restart, or quit the game.
  • Displays current score during gameplay.
  • Cool animations and color effects for snake and food.

Screenshots

Main Menu In-Game Game Over
Screenshot 2024-10-16 193835 Screenshot 2024-10-16 193940 Screenshot 2024-10-16 193910

Output

snakegame.mp4

Prerequisites

You need to have Python installed on your machine. You can download it from here.

You will also need the Pygame library. You can install it using pip:

pip install pygame

To Run

Run the following command to play the game

python game.py

Controls

  • Arrow Keys / WASD: Move the snake up, down, left, or right.
  • Start Button: Begin the game from the main menu.
  • Quit Button: Exit the game from either the main menu or game over screen.

How to Play

  1. Start the Game: Upon launching the game, click on the "Start" button to begin.
  2. Control the Snake: Use the arrow keys or WASD to move the snake around the screen.
  3. Eat the Food: Guide the snake to the red food to increase your length and score.
  4. Avoid Collisions: If the snake hits the walls or itself, the game will end.
  5. Game Over: When the game is over, you can choose to either play again or quit.

Built With

  • Python: The core programming language.
  • Pygame: Used to handle game mechanics, graphics, and rendering.

Author

  • Safwan Sayeed