Skip to content

huzaifa157/Snack.py

Repository files navigation

Snake Game

Overview

This project is a classic implementation of the Snake game using Python and Pygame. It serves as an educational example of game development fundamentals, including user input handling, game state management, and multimedia integration.

Features

  • Classic Snake Gameplay: Control the snake to consume food and grow.
  • Sound Effects: Enjoy sound effects for eating food and game over.
  • Background Music: Features continuous looping background music.
  • Dynamic Scoring: Real-time scoring with high score tracking.
  • Interactive UI: Includes an introductory screen and game over screen with visual effects.

Installation

To set up and run this project locally, follow these instructions:

  1. Clone the Repository
    git clone https://github.com/huzaifa157/Snack.py.git
  2. Navigate to the Project Directory
    cd Snack.py
  3. Install Dependencies

    Ensure Python is installed. Then, install the required package using pip:

    pip install pygame

Usage

To start the game, run the following command:

python snake.py

Controls

  • Arrow Keys: Navigate the snake.
  • Q Key: Increase the score by 10 (cheat code).
  • Enter Key: Start or restart the game.
  • Escape Key: Quit the game.

Assets

The game includes the following assets:

  • bite.mp3: Sound effect for eating food.
  • Game_over.wav: Sound effect for game over.
  • Music_bgm.mp3: Looping background music.
  • Snack.bg.png: Game background image.
  • introduction.webp: Introductory screen image.
  • out.png: Game over screen image.

Ensure these files are located in the same directory as the script for proper functionality.

Development

This project was developed by Huzaifa and demonstrates basic game development principles using Pygame. It includes game loops, event handling, and multimedia features.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages