space-invaders is an OpenGL-based emulator in Rust for the Space Invaders arcade machine.
This program targets the latest stable version of Rust 1.56.1 or later.
This program uses the glfw-sys
package (via the luminance-glfw
package), which compiles its own copy of the GLFW library. Compiling GLFW on
Linux requires CMake and some X11 development libraries to be installed. You
can install them on Debian-based distributions, as follows:
$ sudo apt install cmake libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev
The "Compiling GLFW" guide provides full details on how to compile GLFW.
This program uses CPAL, a cross-platform audio library, via the rodio
package. On Linux, CPAL depends on the alsa-sys
package, which requires
pkg-config and the ALSA development files to be installed. You can install
them on Debian-based distributions, as follows:
$ sudo apt install pkg-config libasound2-dev
CPAL's README.md
provides more information on its external library
dependencies.
Xcode contains all the necessary header files, libraries, and tools except for CMake. You can install CMake via Homebrew, as follows:
$ brew install cmake
Visual C++ with the "C++ CMake tools for Windows" and "Windows 10 SDK" components contains all the necessary header files, libraries, and tools.
$ git clone https://github.com/dkim/space-invaders.git
$ cd space-invaders
$ cargo update # optional
$ cargo build --release
$ cargo run --release -- --help
space-invaders 1.1.0
space-invaders is an emulator for the Space Invaders arcade machine.
USAGE:
space-invaders <roms> [samples]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<roms> A directory that contains invaders.{e,f,g,h}
<samples> A directory that contains {0..8}.wav
$ cargo run --release -- /path/to/roms /path/to/samples
Key | Description |
---|---|
← | Move Left |
→ | Move Right |
Space | Fire |
C | Insert a coin |
T | Tilt the machine |
1 | Start a game in single-player mode |
2 | Start a game in two-player mode |
F1 | Number of lives: 3 (default) / 4 / 5 / 6 |
F2 | Extra life at: 1000 points / 1500 points (default) |
F3 | Pricing display: on (default) / off |
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.