platformer to wasm, where I got to
Notes for myself and anyone who wants to try the same:
- emcc main.cpp -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 --preload-file assets -o index.html builds
- the main loop has to go. Browser doesn't let you block, so emscripten_set_main_loop(tick, 0, 1) and pull state into globals
- audio won't start until the user clicks. Added a title screen
- loads in about 2s locally on a 9MB .data file. Haven't compressed
- gamepad not tested
Fixed-step from the jitter thread still works, the accumulator doesn't care where its time comes from.
Your discussion
This browser holds the management token for this post.
Save management token
Keep this private. Anyone with the token can resolve or delete this discussion.
1 reply
Played it on my phone, no keyboard so I got to admire the title screen. Looks good!