Asteroids-like arcade game implemented in Rust ✨
rust-belt
is a 2D video game inspired by the classic
Asteroids arcade game,
featuring an original soundtrack 🎼. It is implemented using the
Rust game engine, Piston.
The latest stable release of Rust.
rustup
.rust-belt
uses piston-music
to play music.
piston-music
depends on two third-party non-Rust libraries, SDL2
and SDL2_mixer. Install instructions are provided
below.
Select to proceed with either the MSVC or GNU toolchain.
rustup show
stable-x86_64-pc-windows-msvc
).rustup
during install.SDL2-devel-2.0.x-VC.zip
)..lib
files from SDL2-devel-2.0.x-VC\SDL2-2.0.x\lib\x64\
into a folder.LIB
system environment variable does not exist, create it. Add that folder path toLIB
.SDL2.dll
into the rust-belt
project folder, next to Cargo.toml
.SDL2_mixer-devel-2.0.x-VC.zip
)..lib
files from SDL2_mixer-devel-2.0.x-VC\SDL2_mixer-2.0.x\lib\x64
intoLIB
system environment variable.SDL2_mixer.dll
and libmpg123-0.dll
into the rust-belt
project folder, next toCargo.toml
.rustup show
stable-x86_64-pc-windows-gnu
).pacman --sync mingw-w64-x86_64-gcc
C:\msys64\mingw64\bin
to system PATH
.SDL2-devel-2.0.x-mingw.tar.gz
)..lib
files from SDL2-devel-2.0.x-mingw\SDL2-2.0.x\x86_64-w64-mingw32\lib
LIBRARY_PATH
system environment variable does not exist, create it. AddLIBRARY_PATH
.SDL2.dll
into the rust-belt
project folder, next to Cargo.toml
.SDL2_mixer-devel-2.0.x-mingw.tar.gz
)..lib
files fromSDL2_mixer-devel-2.0.x-mingw\SDL2_mixer-2.0.x\x86_64-w64-mingw32\lib\
into the same folderLIB
system environment variable.SDL2_mixer.dll
and libmpg123-0.dll
into the rust-belt
project folder, next toCargo.toml
.gcc
via Xcode developmentbrew install sdl2
brew install sdl2_mixer --with-flac --with-fluid-synth --with-libmikmod --with-mpg123
sudo apt install libsdl2-dev libsdl2-mixer-dev
To build:
$ cargo build
To run:
$ cargo run --release
Keyboard | Menu | Game |
---|---|---|
W | Up | Accelerate Forward |
S | Down | Accelerate Backward |
A | Rotate left | |
D | Rotate right | |
Space | Select | Shoot |
X | Return to Menu | |
Esc | Exit | Exit |
Special thanks to @aochagavia for rocket, which provided many examples to pull from.
Music composed by @johnthagen. All rights reserved.
Sound from freesound.org.