Sandbox Games: Using WebAssembly and C++ to make a simple game
summary
C++ game logic compiles to WebAssembly with Emscripten and runs in the browser, producing a sliding‑puzzle like 2048 implemented with exported functions and optional embind marshalling; rendering moves to SDL2 textures, fonts must be preload files, and a tiny Python or emrun server is required. Key hurdles: supply JS syscalls for random/timers, set initial memory and growth, preload assets, use source maps for breakpoints; a Wordle bot example hits ~30 games/sec and real projects sometimes report ~20× speedups.
AI-written summary · about
chapters (17)
- 0:00Sandbox games with WebAssembly
- 1:45What this talk covers and its origins
- 3:10WebAssembly basics
- 8:27Setting up Emscripten for development
- 10:33Hello World in WASM
- 14:30Sliding puzzle game
- 15:54C++ and WASM game logic
- 20:14Randomness in sandbox
- 26:20Passing complex data between JavaScript and WebAssembly
- 34:31WASM graphics rendering
- 41:17Memory limits and growth
- 42:22External files embedding
- 44:54CMake and Emscripten build
- 46:17Challenges and solutions
- 48:43Live WASM game demo
- 55:16Q&A: Threads, libs, performance
- 1:01:20Q&A: Porting apps, Rust vs C++
related talks
54mSandbox Games: Using WebAssembly and C++ to Make a Simple Game
01h 12mSandbox Games - Using WebAssembly and C++ to Make a Simple Game
22mSimulating Sand: Building Interactivity With WebAssembly
01h 01mImplementing a web game in C++14
57mC++ on the Web: Let's have some serious fun.
34mBack to the FUTURE! From C++ to JS
22mHarnessing the power of WebAssembly
50mWeb Assembly
