generated from tipragot/rust
This commit is contained in:
parent
061c043d91
commit
178cf417cf
|
@ -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<i32>) -> 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,
|
||||
|
|
Loading…
Reference in a new issue