From a98bb2ecb9a8e6cc20b76e094f7cbed28056b9e4 Mon Sep 17 00:00:00 2001 From: "a.yamaev" Date: Fri, 8 Dec 2023 12:07:31 +0300 Subject: [PATCH] More easy game --- src/player.rs | 2 +- src/sheep.rs | 8 ++++---- src/storyteller.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/player.rs b/src/player.rs index 5fa9d3d..de788b5 100644 --- a/src/player.rs +++ b/src/player.rs @@ -168,7 +168,7 @@ pub fn bark( if input.pressed(KeyCode::Space) { event_writer.send(Bark { - radius: 5., + radius: 10., position: bark.translation, }); } diff --git a/src/sheep.rs b/src/sheep.rs index 97a9d78..7bf7040 100644 --- a/src/sheep.rs +++ b/src/sheep.rs @@ -359,7 +359,7 @@ pub fn update_scared_sheeps( }; for (e, t, mut walk, mut dec, mut scare) in sheeps.iter_mut() { - if scare.time > 2. { + if scare.time > 4. { *dec = Decision::Feed; walk.0 = Vec3::ZERO; commands.entity(e).remove::().insert(IdleFeeding { @@ -384,7 +384,7 @@ pub fn update_scared_sheeps( } } - let speed_amount = (SHEEP_SPEED * (1.0 - dog_distance / SCARE_MAX_DIST)).max(0.0_f32); + let speed_amount = (SHEEP_SPEED * (1.0 - dog_distance / SCARE_MAX_DIST) + SHEEP_SPEED * RANDOM_WALK_SPEED_MULTIPLIER).max(0.0_f32); if let Some(sa) = nearest_sa { let dir_to_sa = (sa.get_center() - t.translation).normalize_or_zero(); @@ -473,7 +473,7 @@ fn idle_feeding_system( type NNTree = KDTree3; -const PREFERED_DISTANCE: f32 = 1.3; +const PREFERED_DISTANCE: f32 = 0.7; const PREFERED_DY: f32 = 0.1; fn collect_field( @@ -524,7 +524,7 @@ fn collect_field( let around_mean_vel = sum / (count as f32); let dv = around_mean_vel - vel.0; walk.target_velocity = - vel.0 + 0.9 * distance_force + Vec3::new(0.0, 0.0, sum_dz); + vel.0 + 10.0 * distance_force + Vec3::new(0.0, 0.0, sum_dz); } else { walk.target_velocity = vel.0; } diff --git a/src/storyteller.rs b/src/storyteller.rs index 36d0057..5a2e9c4 100644 --- a/src/storyteller.rs +++ b/src/storyteller.rs @@ -68,7 +68,7 @@ fn storyteller_system( let c = sheep_count * unfiorm_time * 0.2 + 1.0 + 0.05 * sheep_count; let dt = 10.0 - 3.0 * unfiorm_time; - let n = 2.0 + 2.0 * unfiorm_time; + let n = 1.0 + 2.0 * unfiorm_time; teller.next_wave = Some(SheepWave { count: c as usize,