figs
A simple framework for making 2D games with Rust.

Features
Usage
Add the following to your Cargo.toml:
figs = "0.0.1"
Quick start
use figs::prelude::*;
fn main() -> FigResult<()> {
let mut canvas = Canvas::new("simple example", (320, 320), 60)?;
let mut input = InputManager::new();
let mut assets = AssetLoader::from_tar("examples/assets.tgz");
let mut blob = Entity::new((100.0, 100.0), assets.load_png_dir("blob")?, (8, 8), 20);
input.wasd();
input.arrows();
input.add(Key::Escape);
while canvas.is_open() {
for key in &input.keys {
if canvas.key_down(*key) {
match key {
Key::W | Key::Up => blob.mov(0.0, -1.0),
Key::A | Key::Left => blob.mov(-1.0, 0.0),
Key::S | Key::Down => blob.mov(0.0, 1.0),
Key::D | Key::Right => blob.mov(1.0, 0.0),
Key::Escape => return Ok(()),
_ => (),
}
}
}
blob.update();
canvas.clear();
canvas.draw(&blob);
canvas.update()?;
}
Ok(())
}
See examples/ for more detailed examples.
Contributing
Issues and pull requests are welcome.