generated from tipragot/rust
Adding a map creation plugin #57
|
@ -65,13 +65,12 @@ fn generate_map(
|
|||
fn get_type_tile(position: (f32, f32), noise: &Perlin) -> Tile {
|
||||
CoCo_Sol marked this conversation as resolved
Outdated
CoCo_Sol marked this conversation as resolved
tipragot
commented
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]);
|
||||
match value {
|
||||
v if v <= -0.5 => Tile::Hill, // Réduire le seuil pour les collines
|
||||
v if v <= -0.5 => Tile::Hill, // Réduire le seuil pour les collines
|
||||
v if v >= 0.5 => Tile::Forest, // Réduire le seuil pour les forêts
|
||||
_ => Tile::Grass,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Despawns the tiles if the event : [EndMapGenerationEvent] is received.
|
||||
CoCo_Sol marked this conversation as resolved
Outdated
tipragot
commented
This comment is wrong. This comment is wrong.
|
||||
fn delete_map(
|
||||
CoCo_Sol marked this conversation as resolved
Outdated
tipragot
commented
I still think you should take an HexPosition, this will be simpler and will make this function simpler to use. I still think you should take an HexPosition, this will be simpler and will make this function simpler to use.
|
||||
mut commands: Commands,
|
||||
|
|
Loading…
Reference in a new issue
Why don't you use HexPosition here?
because is not a hex position in a hex grid but a position in orthogonal grid
You need to change the name of the function or take an HexPosition and convert it in the function, because it can be confusing that you use "tile" to describe the orthogonal position of an HexPosition
you are right