|
|
|
@ -41,15 +41,9 @@ pub struct Bridge {
|
|
|
|
|
to: (i32, i32),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Component)]
|
|
|
|
|
#[derive(Component, Default)]
|
|
|
|
|
pub struct GroundContact(pub usize);
|
|
|
|
|
|
|
|
|
|
impl std::default::Default for GroundContact {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
GroundContact(0)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Component)]
|
|
|
|
|
pub struct Ground {
|
|
|
|
|
/// (center x, width)
|
|
|
|
@ -269,9 +263,9 @@ fn add_island(
|
|
|
|
|
let transform = ground.to_transform();
|
|
|
|
|
|
|
|
|
|
let bounds = ground.to_box();
|
|
|
|
|
let mut soil_box = bounds.clone();
|
|
|
|
|
soil_box.max_y = soil_box.max_y - GRASS_HEIGHT;
|
|
|
|
|
let mut grass_box = bounds.clone();
|
|
|
|
|
let mut soil_box = bounds;
|
|
|
|
|
soil_box.max_y -= GRASS_HEIGHT;
|
|
|
|
|
let mut grass_box = bounds;
|
|
|
|
|
grass_box.min_y = soil_box.max_y;
|
|
|
|
|
|
|
|
|
|
let soil_mesh = meshes.add(Mesh::from(soil_box));
|
|
|
|
|