generated from tipragot/rust
This commit is contained in:
parent
ac1fb70b32
commit
9f78f7be49
|
@ -5,21 +5,30 @@ use bevy::ecs::component;
|
|||
use noise::{NoiseFn, Perlin};
|
||||
|
||||
|
||||
/// The different types of tiles in the map.
|
||||
#[derive(Clone, Copy, component::Component, Debug, PartialEq, Eq)]
|
||||
enum Tile {
|
||||
/// The forest tile.
|
||||
Forest,
|
||||
|
||||
/// The hill tile.
|
||||
Hill,
|
||||
|
||||
/// The grass tile (nothing).
|
||||
Grass,
|
||||
}
|
||||
|
||||
/// Postion component of tile in the map.
|
||||
#[derive(component::Component, Debug)]
|
||||
struct Position(f64, f64);
|
||||
|
||||
/// Adjacent entities of tile in the map.
|
||||
#[derive(component::Component)]
|
||||
struct AdjacentCases {
|
||||
entities: Vec<Entity>,
|
||||
}
|
||||
|
||||
/// Generate the map coordinates with a size.
|
||||
fn generate_map_coordinates(size: i32) -> Vec<Vec<(f64, f64)>> {
|
||||
let mut all_tiles = Vec::new();
|
||||
// Iterate over horizontal lines of the map
|
||||
|
|
Loading…
Reference in a new issue