INNER CODE UNIT · Rust

spawn_player

rust-gamedev/rust-game-ports · rusty_roguelike-bevy/src/spawner/mod.rs:5

pub fn spawn_player(ecs: &mut World, pos: Point) {
    ecs.spawn().insert_bundle((
        Player { map_level: 0 },
        PointC(pos),
        Render {
            color: ColorPair::new(WHITE, BLACK),
            glyph: to_cp437('@'),
        },
        Health {
            current: 10,
            max: 10,
        },
        FieldOfView::new(8),
        Damage(1),
    ));
}

pub fn spawn_level(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…