Skip to content

Commit

Permalink
Tune wave values a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Jul 29, 2024
1 parent 7035300 commit db01f5f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/config/theme.ron
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
// CardBorder
Srgba(Srgba(red: 0.071, green: 0.082, blue: 0.133, alpha: 1.000)),
// Overlay
Srgba(Srgba(red: 0.101, green: 0.107, blue: 0.231, alpha: 0.800)),
Srgba(Srgba(red: 0.101, green: 0.107, blue: 0.231, alpha: 0.900)),
)),
)
8 changes: 4 additions & 4 deletions assets/config/wave.ron
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

(
spawn_cadence: 4,
min_distance: 50.0,
max_distance: 200.0,
spawn_count_scale: 5,
max_spawn_count: 20,
min_distance: 150.0,
max_distance: 180.0,
spawn_count_scale: 1.8,
max_spawn_count: 100,
)
5 changes: 3 additions & 2 deletions src/game/wave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct WaveConfig {
pub spawn_cadence: usize,
pub min_distance: f32,
pub max_distance: f32,
pub spawn_count_scale: usize,
pub spawn_count_scale: f32,
pub max_spawn_count: usize,
}

Expand Down Expand Up @@ -86,7 +86,8 @@ fn spawn_wave_enemies(
.filter(|(_, enemy)| enemy.min_level <= level && level <= enemy.max_level)
.collect::<Vec<_>>();

let spawn_count = (level / config.spawn_count_scale).clamp(1, config.max_spawn_count);
let spawn_count =
((level as f32 * config.spawn_count_scale) as usize).clamp(1, config.max_spawn_count);
for _ in 0..spawn_count {
let enemy_key = c!(enemy_pool.choose_weighted(&mut rng, |(_, enemy)| enemy.weight)).0;
let offset =
Expand Down

0 comments on commit db01f5f

Please sign in to comment.