21 stable releases

1.1.5 Apr 1, 2023
1.1.4 Mar 19, 2023
1.1.3 Feb 26, 2023
1.0.12 Jan 31, 2023
1.0.5 Sep 26, 2022

#95 in Graphics APIs

Download history 21/week @ 2023-08-13 42/week @ 2023-08-27 21/week @ 2023-09-03 2/week @ 2023-09-10 1/week @ 2023-09-17 2/week @ 2023-09-24 6/week @ 2023-10-01 1/week @ 2023-10-08 6/week @ 2023-10-22 25/week @ 2023-10-29 2/week @ 2023-11-12 22/week @ 2023-11-19 86/week @ 2023-11-26

110 downloads per month

MIT license

110KB
2.5K SLoC

d7engine

A project by Markus Dick

d7engine is a homemade games engine for fun.

Installation

Make sure that you have Rust installed on your pc by using:

cargo version

or install Rust by using the official Rust installation guid.

Create a new project:

cargo new your_game_name

And add the engine to the project:

cd your_game_name
cargo add d7engine

Basic setup:

//#![windows_subsystem = "windows"]
use d7engine::*;

struct Runt {
    components: ComponentContainer,
    camera: Transform,
}

impl Runtime for Runt {
    fn load(&mut self) {
        let color = Color::rgb(255, 0, 0);
        let mut rect1 = Component::rect().unwrap();
        rect1.set_color(&color);
        rect1.set_dim(100.0, 100.0);
        rect1.transform.set(50.0, 50.0, 0.0);
        self.components.insert("1", rect1);
    }

    fn draw(&mut self, draw: &Draw) {
        self.components.draw(draw, &self.camera).unwrap();
    }
}

fn main() {
    init(Config::default(), &mut Runt{
        components: ComponentContainer::new(),
        camera: Transform::new(),
    });
}

Dependencies

~25–34MB
~549K SLoC