Sandbox Games - Using WebAssembly and C++ to Make a Simple Game
summary
Builds a browser sliding-puzzle and a Wordle bot by compiling C++ to WebAssembly with Emscripten + C++, exposing functions via the module import object and calling them from JS. Shows concrete hurdles: needing a local web server, implementing missing syscalls like random, preloading asset files, and setting memory initial/maximum + memory growth. Demonstrates debugging with source maps and breakpoints, profiling in Chrome, and that the wasm version runs but still faces JS timing and canvas integration issues.
AI-written summary · about
chapters (24)
- 0:00Sandbox games with WebAssembly
- 1:08What this talk covers and doesn't
- 2:11WebAssembly basics
- 6:22Setting up Emscripten for development
- 10:13Hello World in WASM
- 14:26Sliding puzzle game
- 16:32Moving logic to C++
- 20:01Handling OS functions
- 27:44Communicating game state between C++ and JavaScript
- 31:14Full C++ port
- 35:02Debugging with DevTools
- 36:28Performance profiling
- 40:03SDL2 integration
- 41:47WASM memory limits
- 43:32Loading external files
- 45:17Emscripten and CMake
- 50:31JS output analysis
- 54:06Connecting WebGL and WebAssembly
- 56:34Challenges and solutions
- 57:19Live Wordle demo
- 1:00:14Performance comparison of JavaScript vs WebAssembly
- 1:04:36Wordle WASM project
- 1:05:31Debugging techniques for WebAssembly
- 1:07:48WASM threading future
related talks
54mSandbox Games: Using WebAssembly and C++ to Make a Simple Game
01h 09mSandbox Games: Using WebAssembly and C++ to make a simple game
22mSimulating Sand: Building Interactivity With WebAssembly
57mC++ on the Web: Let's have some serious fun.
50mWeb Assembly
34mBack to the FUTURE! From C++ to JS
22mHarnessing the power of WebAssembly
52mWebAssembly: Taking Your C++ and Going Places
