Visual of terminal window where snake game is being played

CS

Developing the Classic Snake Game

I am pleased to present my own version of the classic snake game written in C. In this project, my teammate and I undertook the development of a classic snake game using C primarily utilizing the ncurses library. This project provided us with a significant opportunity to apply our systems programming knowledge and showcase our abilities in game development.

Project Scope

The main challenge of the project lay in working collaboratively as a team. To ensure smooth progress, we defined clear roles and responsibilities for each member. Additionally, we familiarized ourselves with the relevant concepts in the textbook alongside past assignments, which served as the foundation for our implementation.

Snake Pit Environment

The game was set in a snake pit, occupying the entire terminal window. Implementing a visually immersive environment with clearly defined borders was essential for the game’s overall experience.

Snake Character

Our snake began its journey with a length of three characters, and its initial movement direction was randomized for added unpredictability. Players had control over the snake’s movement through the arrow keys on their keyboards. As the snake grew longer, its speed increased, introducing an element of challenge.

Seeking Trophies

The snake pit hid treasures in the form of trophies, each represented by a digit from 1 to 9. Only one trophy was present at a time, and when the snake consumed it, its length increased by the number displayed on the trophy. However, trophies had a limited lifespan and disappeared after a random interval, with a new one appearing elsewhere on the screen afterward.

Gameplay Challenges

While the game offered excitement, it also presented challenges. The snake’s journey came to an end if it collided with the pit’s borders or itself. Furthermore, we ensured that abrupt reversals in the snake’s direction were avoided to maintain gameplay continuity.

Development Milestones

We divided the project into two milestones. The first milestone involved creating a snake of size 5 that moved right, allowing control in all directions, displaying a visible snake pit border, and excluding any trophies. Once we accomplished this, we proceeded to the final milestone, which encompassed implementing all remaining functionalities listed in the project assignment.

Conclusion

As we embarked on this coding adventure, we were eager to demonstrate our capabilities in systems programming and game development. With diligence, teamwork, and a focus on meeting the project’s objectives, we successfully created a polished and engaging classic snake game. This project was a valuable learning experience that allowed us to sharpen our skills and deliver a completed product that met all the required functionalities. Let us reflect on our achievements and consider the lessons learned as we continue on our programming journey. 🐍

Created by Marek Grabowski with