/wasm-snake

Snake in C++ for WebAssembly

Primary LanguageC++

Snake-wasm

Snake in C++ for WebAssembly

This is a primitive greedy snake game demo in C++(ish) to get started with WebAssembly

deploy workflow

Getting Started

Install emscripten

emscripten is required for compiling.

Compile

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.

Notes

SDL2 API reference SDL Wiki

Demo

https://yurikorh.github.io/wasm-snake/