Skip to content

Classic Snake made with pygame library and collections.deque!

License

Notifications You must be signed in to change notification settings

dopecodez/python-pygame-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

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 - The language used
  • Pygame - 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.

Authors

License

This project is free. Use it in whichever way you please.

Acknowledgments

About

Classic Snake made with pygame library and collections.deque!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages