diff --git a/crates/border-wars/src/map/generation.rs b/crates/border-wars/src/map/generation.rs index 7460328..00f4d86 100644 --- a/crates/border-wars/src/map/generation.rs +++ b/crates/border-wars/src/map/generation.rs @@ -63,8 +63,9 @@ fn generate_map_tiles( } /// Gets the type of the tile at the given position with a perlin noise fn get_type_tile(perlin: Perlin, position: HexPosition) -> TypeTile { - // TODO:Implement the pixel coordinate system - let value = perlin.get([position.q as f64, position.r as f64]); + let pixel_position = position.to_pixel_coordinates((0.5, 0.5)); + let coordonate = [pixel_position.0 as f64, pixel_position.1 as f64]; + let value = perlin.get(coordonate); match value { v if v <= -0.3 => TypeTile::Hill, v if v >= 0.3 => TypeTile::Forest,