An implementation of Pong written in Odin using Raylib. Running natively on desktop and compiled to WASM to run in the browser.
Based on the odin-raylib-web project template by Karl Zylinski.
This project was meant to try out the feasability of making a graphical application for the web using WASM with minimal setup. It also tests how usable Odin and Raylib are for a simple game.
- Odin compiler from January 1st 2025 or newer
- https://odin-lang.org/docs/install/#official-releases
- On Windows: Requires MSVC and Windows SDK
- (For web builds) Emscripten SDK
- https://emscripten.org/docs/getting_started/downloads.html#installation-instructions-using-the-emsdk-recommended
- Also
EMSCRIPTEN_SDK_DIRinbuild.bat
- (On Windows) Git Bash
build.batuses Git-Bash by default on Windows to itself under Bash- Git-Bash ships with Git so you should already have it, otherwise install Git
- If you wish to use another Windows Bash, edit the line
set WIN_BASH=inbuild.bat
- For debug builds run
build.bat debug - For release builds run
build.bat web
- Point
EMSCRIPTEN_SDK_DIRinbuild.batto where you installed emscripten. - Run
build.bat web. - Web game is in the
build/webfolder.
Note
On Linux and macOS, build.bat must be invoked as bash build.bat.
Warning
You might not be able to run build/web/index.html directly due to "CORS policy" javascript errors.
You can work around that by running a small server, i.e.:
npx http-server ./build/web -c-1python -m http.server --directory ./build/web