Skip to content

aayushchouhan24/Snake-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game with Pygame

Gameplay

Introduction

Welcome to the Snake game built using the Pygame library! This classic arcade-style game challenges you to control a snake, help it grow by eating food, and avoid collisions with walls and the snake's own body.

Prerequisites

Before you start playing, make sure you have the following requirements met:

  • Python 3.x installed
  • Pygame library installed (pip install pygame)

How to Play

  1. Clone this repository to your local machine or download the ZIP file.

  2. Open a terminal or command prompt and navigate to the project directory.

  3. Run the following command to start the game:

    python snake_game.py
    
  4. Use the arrow keys (or 'W', 'A', 'S', 'D') to control the snake's movement.

    • ↑ or 'W': Move Up
    • ↓ or 'S': Move Down
    • ← or 'A': Move Left
    • → or 'D': Move Right
  5. Eat the food (green dots) to increase your score and the snake's length.

  6. Avoid colliding with the walls and the snake's body. If you collide, the game is over.

  7. Press 'F' while holding the 'Ctrl' key to change the location of the food.

  8. Press '+' or '-' while holding the 'Ctrl' key to adjust the snake's speed.

  9. Press 'M' while holding the 'Ctrl' key to toggle self-collision mode (body crash).

  10. Have fun and try to beat your high score!

Features

  • Classic Snake gameplay with Pygame graphics.
  • Interactive main menu with "Start" and "Quit" buttons.
  • Background music and game over sound effects.
  • Customizable food location, snake speed, and self-collision mode.

Credits

Author

Aayush Chouhan

License

This project is licensed under the MIT License.

About

Snake Game using pygame

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages