chore: apply cargo fmt formatting

This commit is contained in:
Harald Hoyer 2026-05-07 23:31:30 +02:00
parent 52b5c9d7e6
commit ff3416b664
3 changed files with 12 additions and 9 deletions

View file

@ -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 {

View file

@ -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(

View file

@ -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,