whouishere / raysnake

yet another snake clone. mirror from https://codeberg.org/whou/raysnake

Home Page:https://codeberg.org/whou/raysnake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RaySnake

Simple snake game made with raylib!

You can play RaySnake from your browser on https://whou.codeberg.page/raysnake.

TODO:

  • multi-threaded
  • more flexible grid and graphics
  • gameplay twist

Building

Requirements

  • A C99 compatible compiler
  • CMake >= 3.11
  • A working raylib installation (optional)

If you have these simple requirements, use

cmake -B build/ -S .
cmake --build build/

If you want a debug build, pass -DCMAKE_BUILD_TYPE=Debug to the first cmake command.

If you don't have raylib 4.5 installed for CMake, it will fetch the raylib source from GitHub and build it automatically for you.

Then the built binary will be on the build directory.

Web build

It's also possible to play the game on the browser with WebAssembly. To build a target for browsers, first follow Emscripten's install instructions and use a slightly different cmake command:

emcmake cmake -B build/emscripten -S . -DPLATFORM=Web
cmake --build build/emscripten

Now you can setup a web server with Python to test the output:

python -m http.server -d build/emscripten

The game will now be available on http://localhost:8000/raysnake.html.

Android build

There's also an experimental build for Android. You must first have at least OpenJDK 18 installed and the Android ADK with NDK and CMake installed.

Then you can enter the android folder and build the app with Gradle:

cd android
./gradlew assemble

The release APK will be on the android/app/build/outputs/apk/release folder. If you want to immediately use the debug build, you can run ./gradlew installDebug to install it on a connected device.


Have fun! :)

License

RaySnake is licensed under GPL 3.0 or later. You may freely copy, distribute and modify it. Any modifications must also be distributed under GPL. You can read the COPYING file for more information.

RaySnake uses raylib, which is licensed under Zlib.

About

yet another snake clone. mirror from https://codeberg.org/whou/raysnake

https://codeberg.org/whou/raysnake

License:GNU General Public License v3.0


Languages

Language:C 94.3%Language:CMake 3.1%Language:HTML 1.6%Language:Shell 0.5%Language:JavaScript 0.4%Language:Java 0.1%