Skip to content

Commit

Permalink
Fix torch and level sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
rewin123 committed Dec 6, 2023
1 parent e86bc5f commit 810ead6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn player_movemnt_by_wasd(

let dspeed = target_speed - player.0;

let accel = accel.min(dspeed.length() * 1000.0);
let accel = accel.min(dspeed.length() * 100.0);

player.0 += dspeed.normalize_or_zero() * accel * time.delta_seconds();

Expand Down
2 changes: 1 addition & 1 deletion src/sheep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn setup(
});

//spawn sheeps
let r = TEST_LEVEL_SIZE;
let r = TEST_LEVEL_SIZE / 2.0;
let mut rng = rand::thread_rng();
let sheep_count = 100;

Expand Down
8 changes: 4 additions & 4 deletions src/test_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{player::SpawnPlayer, safe_area::SafeArea, torch::SpawnTorch, sprite_

const TREE_PATH: &str = "test/pine.png";

pub const TEST_LEVEL_SIZE: f32 = 30.0;
pub const TEST_LEVEL_SIZE: f32 = 20.0;

pub fn setup(
mut commands: Commands,
Expand Down Expand Up @@ -69,7 +69,7 @@ pub fn setup(
});

let tree_r = r * 2.0;
let cut_r = r + 10.0;
let cut_r = r + 5.0;

let tree_area_size = PI * tree_r * tree_r - PI * cut_r * cut_r;
let tree_per_meter = 1.0;
Expand Down Expand Up @@ -114,7 +114,7 @@ pub fn setup(
position: Vec3::new(-r - 2.0, 0.0, 0.0),
});

let num_of_torchs = 4;
let num_of_torchs = 10;

for _ in 0..num_of_torchs {
let pos = Vec3::new(rng.gen_range(-r..r), 0.0, rng.gen_range(-r..r));
Expand All @@ -124,6 +124,6 @@ pub fn setup(

commands.spawn(SafeArea::Rect {
pos: Vec2::ZERO,
size: Vec2::new(r, r),
size: Vec2::new(r * 1.5, r * 1.5),
});
}
4 changes: 2 additions & 2 deletions src/torch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ fn spawn_torch(
point_light: PointLight {
color: Color::ORANGE,
intensity: 10000.0,
range: 300.0,
radius: 100.0,
range: 5.0,
radius: 5.0,
shadows_enabled: false,
..default()
},
Expand Down

0 comments on commit 810ead6

Please sign in to comment.