- 3 different levels of difficulty
- Increasing speed as score increases
- 90's style graphics using Ncurses library
- Ability to keep track of high score for a round
- Safe multithreading using a Mutex
- Highly modular design
int main() {
do {
Welcome_User();
Get_Difficulty_Level();
Init_Game_Object();
Start_Threads();
// main thread waits for game threads to finish
Output_Score();
Ask_To_Play_Again();
} while(user_wants_to_play)
Print_High_Score();
}
- Provides a wrapper around key functions of the Snake class
- Provides functions for outputting messages to the screen
- Provides getters and setters for access to Snake member variables from main.cc
- Handles safe access to _direction member variable via std::mutex library
- Provides logic for advancing the snake and checking the new area the snake is in each frame
- Multi-player
- Multi-Fruit
- Moving Fruit
- Moving this game online
- Allowing user to pause and resume the game
- Using Gtests with Ncurses. These don't work right now.
ncurses (new curses) is a library providing a set of APIs that allows the programmer to write text-based user interfaces in a terminal-independent manner. It is a toolkit for developing "GUI-like" application software that runs under a terminal emulator. It also optimizes screen changes, in order to reduce the latency experienced when using remote shells.
Well installing ncurses library is an easy task, you just have to follow the steps listed below:
sudo apt-get install libncurses5-dev libncursesw5-dev
- Install Homebrew (if not already):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install ncurses package:
$brew install ncurses
You can run this using bazel
:
bazel run src/main:main