This is a simple implementation of the classic Snake game using Pygame library. The game involves controlling a snake to eat food and grow longer. The game is over if the snake hits the edges of the screen or collides with its own body.
To run the game, first ensure that Pygame is installed. You can install it by running the following command:
pip install pygame
Run the code using the following command:
$python snake_game.py
To contribute to a project on GitHub, follow these steps:
-
Fork the repository by clicking on the "Fork" button on the project's GitHub page.
-
Clone the forked repository to your local machine by following the steps in the previous answer.
git clone https://github.com/Halip26/snake-game.git cd snake-game
-
Make changes or add new features to the codebase on your local machine.
-
Stage and commit your changes using the command "git add " and then "git commit -m " in Git Bash.
-
Push your changes back to your forked repository on GitHub using the command "git push origin ".
-
Create a new pull request from your forked repository to the original repository by clicking on the "New pull request" button on the project's GitHub page.
-
Write a detailed description of your changes and why they're necessary, and then click on the "Create pull request" button.
-
Wait for the project maintainers to review your pull request, make any necessary changes, and then merge your changes into the main codebase.
Use arrow keys to control the movement of the snake. Press 'Q' to quit the game. Press 'C' to play again after losing. Credits
This game implementation was created by Halip26.