update
All checks were successful
Rust Checks / checks (push) Successful in 1m11s
Rust Checks / checks (pull_request) Successful in 1m13s

This commit is contained in:
CoCo_Sol 2024-02-21 18:41:47 +01:00
parent f184c93804
commit 7f255d081c

View file

@ -10,7 +10,7 @@ use super::{Tile, TilePosition};
pub struct MapGenerationPlugin;
/// The zoom of the map during the generation.
const MAP_GENERATION_ZOOM: f32 = 0.2;
const MAP_GENERATION_ZOOM: f32 = 5.;
impl Plugin for MapGenerationPlugin {
fn build(&self, app: &mut App) {
@ -75,7 +75,7 @@ fn generate_map(
/// Returns the type of the [HexPosition] with the given noise.
fn get_type_tile(position: HexPosition<i32>, noise: &Perlin) -> Tile {
let pixel_position = position.to_pixel_coordinates() * MAP_GENERATION_ZOOM;
let pixel_position = position.to_pixel_coordinates() / MAP_GENERATION_ZOOM;
let value = noise.get([pixel_position.x as f64, pixel_position.y as f64]);
match value {
v if v <= -0.4 => Tile::Hill,