nightshade-api 0.41.0

Procedural high level API for the nightshade game engine
Documentation
use nightshade_api::prelude::*;

fn main() {
    let mut app = open();
    show_grid(&mut app.world, false);
    set_bloom(&mut app.world, true);
    set_fog(
        &mut app.world,
        Some(Fog {
            color: [0.7, 0.75, 0.85],
            start: 30.0,
            end: 120.0,
        }),
    );
    spawn_floor(&mut app.world, 60.0);

    for index in 0..14 {
        let angle = index as f32 * 0.55;
        let height = 3.0 + (index as f32 * 1.7).sin().abs() * 7.0;
        let distance = 9.0 + index as f32;
        let center = vec3(angle.cos() * distance, height * 0.5, angle.sin() * distance);
        spawn_object(
            &mut app.world,
            Object {
                position: center,
                scale: vec3(2.0, height, 2.0),
                color: rgb(0.35, 0.37, 0.42),
                ..Object::default()
            },
        );
        let window_glow = center + vec3(0.0, height * 0.5 + 0.5, 0.0);
        point_light(&mut app.world, window_glow, [1.0, 0.7, 0.3], 4.0);
    }

    orbit_camera(&mut app.world, vec3(0.0, 4.0, 0.0), 35.0);
    while frame(&mut app) {
        let hour = (8.0 + elapsed_seconds(&app.world)) % 24.0;
        set_time_of_day(&mut app.world, hour);
    }
}