A minimal Snake game!
You can either:
To build the project locally, first download it from GitHub or clone the repo:
git clone https://github.com/pepperjackdev/snakeA utility Makefile is provided to simplify the build process:
make g– generates the build scriptsmake b– builds the sourcesmake r– runs the game
Each target depends on the preceding one. If you just want to run the game, use:
make rFor each of these targets, there's a WebAssembly counterpart using Emscripten:
make eg– generates build scripts for WebAssemblymake eb– builds for WebAssemblymake er– runs the WebAssembly version
You can also build the project using CMake directly:
-
Open a terminal in the local repository
-
Create a new directory for the build (e.g.,
mkdir build) -
Move into that directory:
cd build -
Generate the build scripts with:
cmake ..
-
Build the sources using your preferred build system (e.g., if you're using Ninja):
ninja
The game is extremely lazily developed minimal. Just run it and start playing by moving the snake with your WASD keys. To replay, simply close and re-run the game.