[][src]Crate procedural_generation

Utility for creating procedurally generated maps

Quick Start

use procedural_generation::Generator;

fn main() {
    let size = Size::new((4, 4), (10, 10));
    Generator::new()
        .with_size(30, 10)
        .spawn_terrain(1, 50)
        .spawn_rooms(2, 3, &size)
        .show();
}

Produces the following (prints with colors in terminal!):

0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 0 1 1 1 1 1 1 0 0 0 1 1 0
0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 0
0 0 0 0 1 1 0 1 1 1 0 0 1 1 0 1 1 0 0 1 0 2 2 2 2 2 2 0 0 0
0 1 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 0 0 1 1 2 2 2 2 2 2 0 0 0
0 0 0 0 0 1 1 0 1 1 0 1 1 1 1 0 0 0 0 1 1 2 2 2 2 2 2 0 0 0
0 0 1 1 1 1 2 2 2 2 2 2 2 2 2 1 1 0 1 1 1 2 2 2 2 2 2 1 0 0
0 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 0 0 0 1 0 2 2 2 2 2 2 1 1 0
0 1 1 1 1 1 2 2 2 2 2 2 2 2 2 0 0 0 0 1 1 2 2 2 2 2 2 1 1 1
0 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 1 1 0 1 0 2 2 2 2 2 2 0 1 1
0 1 1 1 1 1 2 2 2 2 2 2 2 2 2 1 1 1 0 1 1 2 2 2 2 2 2 0 1 1

Structs

Generator

The foundation of this crate

Size

Size constraints for spawning rooms