A simple snake game written in C using the ncurses library.
Author: Mogria m0gr14@gmail.com
Co-Author: Timo Furrer timo.furrer@gmail.com
If you have git installed you can simply clone the repo using the following command:
git clone https://github.com/mogria/msnake.gitThe advantage of using git is that you can update the downloaded code simply by entering:
git pullIf you don't have git installed you can download a zip file of the repository by clicking on the green
Clone or download button and then extract the downloaded zip file.
Change into the cloned git repository (or the folder where you extracted the zip file) and enter the following commands to compile the game:
mkdir build
cd build
cmake ..
makeAfter you've compiled the game you can execute the bin/msnake file to start the game.
To compile the game, you will need to have cmake installed. Additionally, you will need the build-essential,
libncurses5 and libncurses5-dev packages if you are on a Debian-based distribution.
If yu are not on a Debian-based distribution and you are unable to compile the game, look for similar packages in the repositories of your distribution.
Execute the following command with root privileges to install the packages on a Debian-based distribution.
apt-get install cmake build-essential libncurses5 libncurses5-devTo compile the game, you will need to have access to cmake. To get CMake, either install it via Homebrew using
brew install cmake or download the latest version from cmake.org.
If the cmake command is available in your terminal you have successfully installed CMake.
You need to have the packages ncurses-devel and cmake installed.
You can either download an old compiled win32 executable in the download section or compile the game yourself.
The latter requires you to have CMake and MinGW installed. Another prerequisite is the pdcurses packaged, installed
using mingw-get.
Finally, open the command line and run:
cmake -g "MinGW Makefiles" .
makeTo install this game to your system simply execute the following command with root-privileges:
make installThe install script simply moves bin/msnake to /usr/bin/msnake. Assuming your PATH environment variable is set up
correctly, this will allow you to start the game by running msnake in your terminal.
You can easily create a Debian package of msnake. If a binary does not yet exists the script will build one. Simply run the following script to build the package:
./makedeb.shAnd with the following command you can install it, provided you have root-privileges:
dpkg -i msnake.debTo contribute to this awesome project, you can visit its repository on GitHub, fork it and create your own branch.
You can pick a task from the to-do list below or simply do something else. Once you have finished your work, create a pull request on GitHub and we will likely merge your stuff into our repository.
This list contains a list of features we want to implement or change.
- Add a scroll function to the highscore or delete lower entries?
- A settings menu
- More food with different effects?
- A fruit which changes the direction of the snake or its controls?
- Better documentation of the source code
- Optimize the code
- The snake moves are inefficient, as every part is moved which makes the game very slow if you have a large snake. We should rather move/copy the last part to the new position
- Improve color coding
- Make different difficulty mode with different speeds and amounts of fruits. Also provide a "free"/"classic" mode which is the current game mode.
- Add levels and quests?
