Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dolfost/snake-cpp
An Clang ncurses snake game
https://github.com/dolfost/snake-cpp
c cpp game ncurses snake snake-game
Last synced: about 12 hours ago
JSON representation
An Clang ncurses snake game
- Host: GitHub
- URL: https://github.com/dolfost/snake-cpp
- Owner: Dolfost
- License: mit
- Created: 2023-04-06T19:24:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-08T18:47:59.000Z (4 days ago)
- Last Synced: 2025-01-08T18:48:44.523Z (4 days ago)
- Topics: c, cpp, game, ncurses, snake, snake-game
- Language: C++
- Homepage:
- Size: 7.39 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snake-cpp
Hello and welcome to the home of the ncurses snake game written in [neovim][nvim] by one enthusiast in his spare time!
### Game features
- [x] Speed
- [x] Performance
- [x] Beauty
- [x] Portability
- [x] Tries to be *POSIX-compliant*
- [x] "Window" system
- [x] Game itself
- [x] Scoreboard
- [x] Help window
- [x] Log windows
- [x] Terminal options## Screenshots
![Pause](screenshots/gamepause.png "Pause") | ![Game over](screenshots/over.png "Game over")
:---:|:---:
![Standby](screenshots/standby.png "Standby") | ![Scoreboard](screenshots/scoreboard.png "Scoreboard")
![Help](screenshots/help.png "Help") | ![Log](screenshots/log.png "Log")![Sidelog](screenshots/sidelog.png "Sidelog")
## How to install
### Installing dependencies
Game relies on the
- [newcurses][ncurses] C library, likely You will have to install it on Your machine.
- [cmake][cmake] program.
##### Mac OS
If You use MacOS You can install [newcurses][ncurses] with [homebrew][brew] simply bybrew install ncurses
##### Unix-like OS
Short answer: _It depends._
For example, if You are using Ubuntu You can install [newcurses][ncurses] and
[g++][compiler] bysudo apt-get install libncurses5-dev libncursesw5-dev clang
If You say _I use Arch btw_ often, You can try
sudo pacman -S ncurses g++
If Your distro isn't mentioned here, try to use [google](https://www.google.com):
how to install ncurses in *put Your distro name here*
how to install g++ in *put Your distro name here*
how to get cmake running on *put Your distro name here*
### Getting the sources
Enter desired directory and rungit clone https://github.com/Dolfost/snake-cpp
cd snake-cppIt will create the directory with name `snake-cpp` and enter it. Then You have
to compile the game.### Compiling the game
To build the game You can:cmake -B build; cmake --build build
./build/src/snakegameIt will create the game executable `snakegame` in the `build/src` directory.
## Running the game
- Open the terminal window not smaller than 42 lines by 80 columns
- To start the game You can execute
```
./build/src/snakegame
```
in the git directory root.If You are new to the game (probably You are), I recommend You to start
game with the `--help` or `-h` option, so You can get used to it.
```
./build/src/snakegame --help
```
Game files will be located in `../var` relative to game executable
(`build/var` if following this guide).## Contributing
If You find any bugs or unexpected behaviors or just want to
contribute to the snake-cpp, You are welcome at the [issues tab][issue].[nvim]: https://github.com/neovim/neovim "Go to nvim github page"
[ncurses]: https://en.wikipedia.org/wiki/Ncurses "Go to ncurses wikipedia page"
[brew]: https://brew.sh "Visit homebrew homepage"
[issue]: https://github.com/Dolfost/snake-cpp/issueso "Go to issues tab"
[cmake]: https://en.wikipedia.org/wiki/CMake "Go to CMake wikipedia page"
[compiler]: https://en.wikipedia.org/wiki/GNU_Compiler_Collection "Go to GNU compiler collection wikipedia page"