Skip to content

Commit

Permalink
More easy game
Browse files Browse the repository at this point in the history
  • Loading branch information
ayamaev-se committed Dec 8, 2023
1 parent dab4864 commit a98bb2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub fn bark(

if input.pressed(KeyCode::Space) {
event_writer.send(Bark {
radius: 5.,
radius: 10.,
position: bark.translation,
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/sheep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<IsScared>().insert(IdleFeeding {
Expand All @@ -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();
Expand Down Expand Up @@ -473,7 +473,7 @@ fn idle_feeding_system(

type NNTree = KDTree3<Sheep>;

const PREFERED_DISTANCE: f32 = 1.3;
const PREFERED_DISTANCE: f32 = 0.7;
const PREFERED_DY: f32 = 0.1;

fn collect_field(
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/storyteller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a98bb2e

Please sign in to comment.