Home

Awesome

<p align="center"> <img src=https://github.com/RandyGaul/cute_snake/blob/master/title.gif> </p>

Cute Snake

A silly implementation of the game Snake as an example of how to make a small 2D game using Cute Framework (CF).

Building

# Windows batch file to build Cute Snake via cmake with a MingW compiler.
mkdir build_mingw > nul 2> nul
cmake -G "Unix Makefiles" -Bbuild_mingw .
cmake --build build_mingw
#!/bin/bash

# Bash script to build Cute Snake via cmake.
mkdir -p build_bash
cmake -Bbuild_bash .
cmake --build build_bash

This example uses cmake's FetchContent feature to download and build CF the first time Snake is built.

Web Build

If you'd like to try out the web build, be sure to follow along here to get setup with the Emscripten compiler. Once done you can try running emscripten.cmd on Windows to generate an emscripten build via CMake. It doesn't do much internally, just a few commands from the Emscripten docs on using emcmake and emmake to build.

You can run emscripten.cmd -run to create a launch the demo in your default web browser, or emrun --verbose snake.html manually from your CMake build folder.