bottomless-pit

Crates.iobottomless-pit
lib.rsbottomless-pit
version0.4.0
sourcesrc
created_at2023-03-29 02:22:54.465621
updated_at2024-09-17 16:27:31.763065
descriptionA very simple 2D rendering/game engine inspired by raylib
homepage
repositoryhttps://github.com/EggShark/bottomless-pit
max_upload_size
id823607
size920,585
EggShark (EggShark)

documentation

README

Bottomless-pit (working title)

Bottomless-pit is a simple 2D game engine that is still a work in progress. This library is inspired slightly by Raylib and other rust based game engines like GGEZ. All Bottomless-pit does currently is handle keyboard and mouse input while also providing a simple way to draw objects to the screen. The shape and texutre renderer is written in house, but the text rendering is powered by glyphon. To get started start by implmenting the Game trait on any struct you like

use bottomless_pit::Game;
use bottomless_pit::engine_handle::{Engine, EngineBuilder};
use bottomless_pit::render::RenderInformation;
fn main() {
    let engine = EngineBuilder::new()
        .build()
        .expect("Failed to crate the engine!");
    let game = CoolGame::new(&mut engine);
    engine.run(game);
}

struct CoolGame {
    // put whatever you want here
}

impl CoolGame {
    pub fn new(engine_handle: &mut Engine) {
        // you can even load assets before the game opens
    }
}

impl Game for CoolGame {
    fn render<'pass, 'others>(&'others mut self, mut render_handle: RenderInformation<'pass, 'others>) where 'others: 'pass {
        // render what ever you want
    }
    fn update(&mut self, engine_handle: &mut Engine) {
        // this is where all your logic should go
    }
}
Commit count: 223

cargo fmt