Skip to content

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

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dkim/space-invaders

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 -- --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

Controls

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

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

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks