Snake game icon

Snake Game

This is a classic implementation of the Snake game built with Python and Pygame, utilizing object-oriented programming principles. The game features a grid-based coordinate system with precise collision detection mechanics. Players control a snake that grows as it consumes food while avoiding self-collision. The implementation showcases proper game loop architecture, real-time state management.

Technologies Used

Snake game icon
Snake gameplay demonstration
Snake game icon

Challenges Faced

During development, I encountered several technical and design challenges that tested my problem-solving skills and pushed me to learn new concepts.

โšฝ

Visual update of snake position

I struggled to draw the snake in the correct position on the grid whenever changing directions. I updated the way the snake changed direction to a vector this made it easier to calculate the position of the snake on the grid.I then removed the last item in the snake array to tidy up the tail. This allowed me to draw the snake in the correct position on the grid and give the impression of movement.

๐Ÿ”

Needs install to run

The game requires Python and Pygame to be installed to run. I should have provided a more detailed README with installation instructions and dependencies.

Reflections

๐Ÿงน

Better Documentation

Could have made more detailed Requirements and comments to help future developers understand the code better. This would have made it easier to maintain and extend the project in the future.

๐Ÿ’ฅ

Border loop not neccessary

Alowing the snake to collide with a border instead of having a loop would have made the game more challenging and fun. I should have implemented this feature to enhance gameplay.

Future Improvements

Could have added additional difficulty using speed levels of the snake, I would also of added data persistence to allow for a leaderboard