The Snake Game is an iconic game that has a special place in my heart ever since I had first encountered it on a Nokia 3100. I was interested in building a simple game for a long time and so here's my attempt at making the famous snake game. I wanted to keep it as simple and close to the original game as possible. This is also my first CS project ever. I have a few months of experience with Python and no prior experience with Pygame. It took me a little over a day to code the entire thing.
The snake game works on Python 2.7+ and requires Pygame to be installed (can be done easily by pip). Additionally, sound effect files (.wav) can be downloaded if running the final version 'snakey.py'.
- The snake (snakey) moves on pressing the 4 arrow keys of the keyboard
- The aim of the game is to eat the red food particles by moving towards it
- On eating a food particle, snakey gets bigger
- Snakey should stay within the boundaries of the screen
- One of my biggest challenges was getting the movement of the snake right - it took a while to append the snake correctly and I had to run the code several times to understand how to change the coordinates
- Understanding Pygame syntax
- How to improve the game after getting the basic algorithm right - after having gotten the main part of the game right, it was much easier to do things such as creating boundaries, adding sound effects, etc.
This project is licensed under the MIT License - see the LICENSE.md file for details.
I am constantly inspired by my really cool CS professor Debayan Gupta and my best friend "smol gurl".