Snake in C++ for WebAssembly
This is a primitive greedy snake game demo in C++(ish) to get started with WebAssembly
emscripten is required for compiling.
emcc web.cc snake.cc -s USE_SDL=2 -s ASSERTIONS=1 -s SAFE_HEAP=1 -s TOTAL_MEMORY=134217728 -O3 -o index.html
You can use a http server like Live Server to view the demo, or use
python3 -m http.server
.
SDL2 API reference SDL Wiki