Adding a map creation plugin #57

Merged
CoCo_Sol merged 39 commits from map-generation into main 2024-02-21 20:10:03 +00:00
Showing only changes of commit f5ffcffb13 - Show all commits

View file

@ -65,8 +65,8 @@ fn generate_map(
fn get_type_tile(position: (f32, f32), noise: &Perlin) -> Tile { fn get_type_tile(position: (f32, f32), noise: &Perlin) -> Tile {
CoCo_Sol marked this conversation as resolved
Review

This should be in the get_type function and the value shouldn't be hard coded

This should be in the get_type function and the value shouldn't be hard coded
let value = noise.get([position.0 as f64, position.1 as f64]); let value = noise.get([position.0 as f64, position.1 as f64]);
match value { match value {
v if v <= -0.5 => Tile::Hill, v if v <= -0.4 => Tile::Hill,
v if v >= 0.5 => Tile::Forest, v if v >= 0.4 => Tile::Forest,
_ => Tile::Grass, _ => Tile::Grass,
} }
} }