amethyst 0.1.0

Data-oriented game engine written in Rust
Documentation

Amethyst

Build Status MIT License Join the chat

Experimental data-oriented game engine written in Rust. This project is a work in progress and very incomplete; pardon the dust!

Documentation

Read the associated online book for a comprehensive tutorial to using Amethyst. There is also an online crate-level API reference.

Building Locally

You can build the book locally with:

cargo install mdbook
mdbook build book

The text can be found in book/html/index.html. To generate the API documentation locally, do:

cargo doc

The API reference can be found in target/doc/amethyst/index.html.

Hello, World!

Create a new Cargo binary project with cargo new --bin crate_name and add the following lines to your "Cargo.toml":

[dependencies.amethyst]
git = "https://github.com/ebkalderon/amethyst.git"
branch = "master"

Then, in your "main.rs", type or copy and paste the following code:

extern crate amethyst;

use amethyst::engine::{Application, Duration, State};

struct HelloWorld;

impl State for HelloWorld {
    fn new() -> HelloWorld {
        HelloWorld
    }

    fn on_start(&mut self) {
        println!("Begin!");
    }

    fn update(&mut self, _delta: Duration) {
        println!("Hello from Amethyst!");
        std::process::exit(0);
    }

    fn on_stop(&mut self) {
        println!("End!");
    }
}

fn main() {
    let mut game = Application::new(HelloWorld);
    game.run();
}

Compile and run the example with cargo run. You should see "Hello from Amethyst!" print out to the terminal and abruptly exit.

Contributing

Amethyst is an open-source project that values community contribution. Pull requests are welcome!

We assume you have granted non-exclusive right to your source code under the MIT license and you have processed your code with rustfmt prior to submission. If you want to be known as an author, please add your name to the AUTHORS.md file in the pull request.