apparatus 0.0.1

A 2D game engine
Documentation

Apparatus Game Engine

Apparatus is a game engine that takes its inspiration from a number of sources including Dragonfly, olcPixelGameEngine and Arcade, amongst others.

Getting started

Implement the Game trait and run the GameEngine:

use anyhow::Result;
use log::info;
use std::time::Duration;
use firefly::{Game, GameEngine, GameEngineSettings, GameError, Gfx, Input};

struct Example {}

impl Game for Example {
    fn on_create() -> Result<Self, GameError> {
        let game = Example {};

        Ok(game)
    }
    fn on_update(&mut self, input: &impl Input, dt: Duration) {
        info!("on_update");
    }
    fn on_render(&self, gfx: &mut impl Gfx) {
        info!("on_render");
    }
}

fn main() -> Result<()> {
    let engine = GameEngine::new("Getting started", GameEngineSettings::default());
    engine.run::<Example>()?;

    Ok(())
}

See the examples for more in-depth usage.

Examples

Development

Running tests

Run tests from the command line with cargo:

cargo test

Versioning

Apparatus is in very early development and does not currently follow semver. Neither does it commit to a minimum supported Rust version.