Crate kon

Crate kon 

Source
Expand description

§Kon Engine

Modular, plugin-based 2D game engine.

§Example

use kon::prelude::*;

#[component]
struct Position { x: f32, y: f32 }

#[system]
fn setup(ctx: &mut Context) {
    ctx.world_mut()
        .spawn()
        .insert(Position { x: 0.0, y: 0.0 })
        .tag("player")
        .id();
}

fn main() {
    kon::init_logger();

    Kon::new()
        .add_plugin(DefaultPlugins)
        .add_startup_system(setup)
        .run();
}

Re-exports§

pub use kon_core;
pub use kon_ecs;
pub use log;

Modules§

prelude
Common imports for Kon Engine

Structs§

DefaultPlugins
Default plugins bundle

Constants§

VERSION
Engine version

Attribute Macros§

component
Marks a struct as a component
system
Marks a function as a system