Giter Club home page Giter Club logo

snakegame's Introduction

Snake Game

Welcome to the Snake Game, a classic arcade-style game implemented in Python using the Pygame library.

Table of Contents

Introduction

Snake Game is a recreation of the classic Snake game where players control a snake that moves around the screen, eating apples to grow longer while avoiding collisions with the walls or its own tail. The game becomes progressively more challenging as the snake grows in length.

Features

  • Real-time snake movement and control
  • Random generation of apples for the snake to eat
  • Wall boundaries to contain the snake within the game area
  • Score tracking to keep track of the player's progress
  • Background music to enhance the gaming experience

Prerequisites

Before running the game, ensure you have the following installed:

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

Installation

  1. Clone this repository to your local machine:

    bashCopy code

    git clone https://github.com/ByteBender24/SnakeGame.git

  2. Navigate to the project directory:

  3. Run the game:

    python snake_game.py

How to Play

  • Use the arrow keys (or WASD) to control the direction of the snake.
  • Navigate the snake to eat the red apples that appear on the screen.
  • As the snake eats apples, it grows longer.
  • The game ends if the snake collides with the walls or its own tail.

Controls

  • Left Arrow Key or A: Move left
  • Right Arrow Key or D: Move right
  • Up Arrow Key or W: Move up
  • Down Arrow Key or S: Move down

Scoring

  • Each apple eaten increases the player's score by 1 point.
  • The score is displayed in the top-right corner of the game screen.

Game Over

  • If the snake collides with the walls or its own tail, the game ends.
  • The player's final score is displayed, and the game restarts automatically.

Credits

Contributions

We welcome contributions from the community to improve the Snake Game project. If you'd like to contribute, please follow these steps:

  1. Fork the repository and clone it to your local machine.

  2. Create a new branch for your feature or bug fix:

    git checkout -b feature-name
  3. Make your changes and commit them:

    git add . git commit -m "Description of your changes"

  4. Push your changes to your fork:

    git push origin feature-name

  5. Submit a pull request from your fork to the main repository's main branch.

  6. Your pull request will be reviewed by the project maintainers. Once approved, it will be merged into the main branch.

Please ensure that your contributions adhere to the project's coding standards and guidelines. Thank you for your contributions!

License

This project is licensed under the MIT License. See the LICENSE file for details.

snakegame's People

Contributors

bytebender24 avatar

Watchers

 avatar

snakegame's Issues

Abnormal Movement of snake when arrows are pressed

The snake is moving abnormally like, it is moving as a whole when pressed arrow keys, there is no dynamic block by block movement in them.

Ideas:

  • Update facing attribute of bodyblock
  • Movement and drawing should be somewhat connected ( idk how)
  • Hope it works
  • Chatgpt at last (last resort, don't want)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.