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 066561ff6c - Show all commits

View file

@ -44,9 +44,8 @@ fn generate_map(
if let (Some(perlin), Some(spiral)) = (noise.as_ref(), map_iterator.as_mut()) {
CoCo_Sol marked this conversation as resolved Outdated

Isize will not be great to use for networking because it's length depend on the system that runs the program.
Also you should use type to alias a specific type for the HexPosition used for the map.

Isize will not be great to use for networking because it's length depend on the system that runs the program. Also you should use `type` to alias a specific type for the HexPosition used for the map.

I use only one time the hex position, is it really better to create a new type ?

I use only one time the hex position, is it really better to create a new type ?

You will use it every time you want to make a Query on the HexPosition

You will use it every time you want to make a Query on the HexPosition

ok, you've convinced me

ok, you've convinced me
if let Some(position) = spiral.next() {
let pixel_position = position.to_pixel_coordinates((0.1, 0.1));
let type_tile = get_type_tile(pixel_position, perlin);
commands.spawn((type_tile, position));
commands.spawn((get_type_tile(pixel_position, perlin), position));
} else {
*noise = None;
*map_iterator = None;