RuggRogue can be compiled natively with SDL2 and SDL2_image, and for web browsers using Emscripten.
These steps will create a native Linux binary using system-installed versions of SDL2 and SDL2_image.
- Get the source code: https://github.com/tung/ruggrogue
- Install Rust.
- Install the SDL2 and SDL2_image development libraries for your distribution; for example, these are named
libsdl2-dev
andlibsdl2-image-dev
on Ubuntu. - Run
cargo build --release
The game binary can then be found at target/release/ruggrogue
and played by running cargo run --release
.
The game reads the assets
direction and writes its save file to the current directory.
These steps will create a native Windows executable version of the game.
- Get the source code: https://github.com/tung/ruggrogue
- Install Rust, and remember your choice of MSVC vs. MinGW (GNU) for the next step.
- Choose one of the ways to install SDL2 for Rust on Windows, matching MSVC vs. MinGW for your Rust installation, and don't forget SDL2_image!
- Run
cargo build --release
If there were no errors, the game can be played by running cargo run --release
.
You may need SDL2.dll
from SDL2 and SDL2_image.dll
, libpng16-16.dll
and zlib1.dll
from SDL2_image to run the game properly.
These steps can be run from Linux to create a Windows executable of the game.
- Get the source code: https://github.com/tung/ruggrogue
- Install Rust.
- Run
rustup target add x86_64-pc-windows-gnu
- Install Zig and cargo-zigbuild.
- Download the Windows development libraries for SDL2 and SDL2_image; ensure you get the MinGW versions!
- Extract the SDL2 and SDL2_image files somewhere convenient; they can be safely deleted later.
- Copy the files in
x86_64-w64-mingw32/lib/
from SDL2 into~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/
- Repeat the last step, but with SDL2_image.
- Run
cargo zigbuild --release --target=x86_64-pc-windows-gnu
The file ruggrogue.exe
should appear in the target/x86_64-pc-windows-gnu/release/
directory.
The following DLL files need to be in the same directory for it to run:
SDL2.dll
from thex86_64-w64-mingw32/bin/
directory of the extracted SDL2 filesSDL2\_image.dll
,libpng16-16.dll
andzlib1.dll
from thex86_64-w64-mingw32/bin/
directory of the extracted SDL2_image files
These steps will create a WebAssembly file and supporting files that can appear in a web page for a browser-playable version of the game.
- Get the source code: https://github.com/tung/ruggrogue
- Install Rust.
- Run
rustup target add wasm32-unknown-emscripten
- Install Emscripten version 1.39.20; the latest version won't work!
- Activate Emscripten and run
cargo build --release --target=wasm32-unknown-emscripten
This creates ruggrogue.wasm
, ruggrogue.js
and deps/ruggrogue.data
in the target/wasm32-unknown-emscripten/
directory.
Loading ruggrogue.js
in a hosted web page will load the other files and run the game; to test this on Linux:
- Copy
index.html
from the root of the source code intotarget/wasm32-unknown-emscripten/release/
. - Enter the
target/wasm32-unknown-emscripten/
directory. - Run
python3 -m http.server 9000
- Open
http://127.0.0.1:9000
in a web browser to play the game.