diff --git a/src/enemy.rs b/src/enemy.rs index 20f59c8..feb032a 100644 --- a/src/enemy.rs +++ b/src/enemy.rs @@ -11,8 +11,8 @@ use crate::constants::{ TRACTOR_BEAM_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH, }; use crate::resources::{ - AttackDiveTimer, CurrentStage, EnemySpawnTimer, FormationState, StageConfigurations, - is_special_stage, + is_special_stage, AttackDiveTimer, CurrentStage, EnemySpawnTimer, FormationState, + StageConfigurations, }; const BOSS_BASE_CHANCE: f32 = 0.30; @@ -64,8 +64,8 @@ pub fn spawn_enemies( 0.0, ); - let boss_chance = BOSS_BASE_CHANCE - + (stage.number as f32 * BOSS_CHANCE_PER_STAGE).min(BOSS_CHANCE_BONUS_CAP); + let boss_chance = + BOSS_BASE_CHANCE + (stage.number as f32 * BOSS_CHANCE_PER_STAGE).min(BOSS_CHANCE_BONUS_CAP); let enemy_type = if fastrand::f32() < boss_chance { EnemyType::Boss } else { diff --git a/src/player.rs b/src/player.rs index a552694..67cfb31 100644 --- a/src/player.rs +++ b/src/player.rs @@ -58,10 +58,10 @@ pub fn move_player( transform.translation.x += direction * player.speed * time.delta_secs(); let half_width = PLAYER_SIZE.x / 2.0; - transform.translation.x = transform - .translation - .x - .clamp(-WINDOW_WIDTH / 2.0 + half_width, WINDOW_WIDTH / 2.0 - half_width); + transform.translation.x = transform.translation.x.clamp( + -WINDOW_WIDTH / 2.0 + half_width, + WINDOW_WIDTH / 2.0 - half_width, + ); } pub fn handle_captured_player( diff --git a/tests/special_stage.rs b/tests/special_stage.rs index 2c744f3..fd8e983 100644 --- a/tests/special_stage.rs +++ b/tests/special_stage.rs @@ -110,7 +110,10 @@ fn for_stage_returns_normal_config_at_stage_4() { fn special_stage_has_full_formation() { let configs = StageConfigurations::default(); let config = configs.for_stage(3); - assert_eq!(config.enemy_count, 32, "Special stage should have 32 enemies"); + assert_eq!( + config.enemy_count, 32, + "Special stage should have 32 enemies" + ); assert_eq!( config.formation_layout.positions.len(), 32,