chore: apply cargo fmt formatting
This commit is contained in:
parent
52b5c9d7e6
commit
ff3416b664
3 changed files with 12 additions and 9 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue