https://github.com/dopecodez/python-pygame-snake
Classic Snake made with pygame library and collections.deque!
https://github.com/dopecodez/python-pygame-snake
deque game pygame python python-pygame-snake snake
Last synced: about 2 months ago
JSON representation
Classic Snake made with pygame library and collections.deque!
- Host: GitHub
- URL: https://github.com/dopecodez/python-pygame-snake
- Owner: dopecodez
- License: unlicense
- Created: 2019-06-13T03:39:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-19T07:27:05.000Z (over 5 years ago)
- Last Synced: 2025-03-25T06:51:13.235Z (2 months ago)
- Topics: deque, game, pygame, python, python-pygame-snake, snake
- Language: Python
- Size: 351 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# python-pygame-snake
Classic Snake Game built with pygame library and collections.deque(Arrays are terrible for the memory).
The snake can eat food, grow longer, and collide with itself.
Who likes boundaries, so snake is free to go through one side of the screen and appear on opposite.
Implements background sounds, eating sounds and game over sounds using pygame.mixer() with multiple channels.
Also displays a score and a game over message.Please use the #ESCAPE key to quit the game.
Also note that the backgound-sound.wav is not uploaded. I shall add a new background sound soon but in the meantime, please add a background-sound.wav file to the sounds folder to get the project up and running.
If you have any doubts or clarifications on this code or pygame, hit me up and I'll try to help you guys out!
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
You'll need to install python for running this game. I'm using python 3, you can find it at:
```
https://www.python.org/downloads/windows/
```
You'll also need to install pygame. You can install pygame by checking out this link and following the steps:
```
https://www.pygame.org/wiki/GettingStarted
```
You'll also need a code editor to see how the code goes. Use whichever editor which has python support, I use Visual Studio Code on
Windows 10.### Installing
A simple step to get the game running. Open the terminal to the folder containing snake.py and just type:
```
snake.py
```
If your python environment is set up, the game should appear on the screen.## Built With
* [Python 3](https://docs.python.org/3/) - The language used
* [Pygame](https://www.pygame.org/docs/) - Open Source Game development framework.## Contributing
Anybody with ideas to genuinely improve the project are welcome. We use git flow, so just pull the repo, cut a branch on develop and put a pull request back to us. We will look through the PR as soon as possible.
## Versioning
For the versions available, see the [tags on this repository](https://github.com/your/project/tags).## Authors
* **Govind S** - *Initial work* - [dopecodez](https://github.com/dopecodez)
## License
This project is free. Use it in whichever way you please.
## Acknowledgments
* Hat tip to anyone whose code was used
* Thanks to https://pythonspot.com/snake-with-pygame/ for getting me started
* Thanks to https://codereview.stackexchange.com/questions/183343/snake-game-on-pygame for giving me ideas.
* My old Nokia 7800 for insipiring me to get this done