Skip to content

Repository files navigation

space-invaders

Build Status

space-invaders is an OpenGL-based emulator in Rust for the Space Invaders arcade machine.

A Screenshot of space-invaders

Installation Requirements

This program targets the latest stable version of Rust 1.56.1 or later.

Requirements for Linux Systems

GLFW's Dependencies

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.

CPAL's Dependencies

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.

Requirements for macOS Systems

Xcode contains all the necessary header files, libraries, and tools except for CMake. You can install CMake via Homebrew, as follows:

$ brew install cmake

Requirements for Windows Systems

Visual C++ with the "C++ CMake tools for Windows" and "Windows 10 SDK" components contains all the necessary header files, libraries, and tools.

Installation

$ git clone https://github.com/dkim/space-invaders.git
$ cd space-invaders
$ cargo update # optional
$ cargo build --release

Usage

$ cargo run --release -- --helpspace-invaders 1.1.0space-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 informationARGS: <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

Controls

KeyDescription
Move Left
Move Right
SpaceFire
CInsert a coin
TTilt the machine
1Start a game in single-player mode
2Start a game in two-player mode
F1Number of lives: 3 (default) / 4 / 5 / 6
F2Extra life at: 1000 points / 1500 points (default)
F3Pricing display: on (default) / off

License

Licensed under either of

at your option.

Contribution

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.

About

An OpenGL-Based Emulator in Rust for the Space Invaders Arcade Machine

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages