This Snake Game is a simple yet engaging game where:
- A snake moves around the game board, consuming fruits.
- Each fruit eaten increases the snake's length and the player's score.
- The game ends if the snake collides with the walls or itself.
The game uses keyboard inputs (W, A, S, D) to control the snake's movement.
This program integrates 5 main features:
- Shell Scripting Integration: To build and run the program.
- Timer Signals: To make periodical game updates.
- Keyboard Control: To control the snake's movement.
- Multi-Process Design: To separate game logic and user inputs (total of 2 processes). The parent process updates the game state and the screen, while the child process captures and communicates user inputs.
- Inter-Process Communication: To enable communication between the two processes.
To build this program, two things have to be installed:
- A C compiler
- The
ncurseslibrary
To compile and run the program, run sh Makefile.sh.
Use W (up), A (left), S (down), D (right) to navigate. After the game ends, press X to exit.