here_be_dragons/examples/example1.rs

23 lines
493 B
Rust
Raw Normal View History

2020-10-17 16:25:16 +00:00
use mapgen::{
MapBuilder,
filter::{
NoiseGenerator,
CellularAutomata,
2020-10-19 19:35:24 +00:00
CullUnreachable,
2020-10-17 16:25:16 +00:00
AreaStartingPosition,
XStart,
YStart,
},
};
fn main() {
2020-10-19 19:35:24 +00:00
let map = MapBuilder::new(20, 20)
2020-10-17 16:25:16 +00:00
.with(NoiseGenerator::uniform())
.with(CellularAutomata::new())
.with(AreaStartingPosition::new(XStart::CENTER, YStart::CENTER))
2020-10-19 19:35:24 +00:00
.with(CullUnreachable::new())
2020-10-17 16:25:16 +00:00
.build();
println!("{:}", &map);
}