refactor: remove unused imports from multiple files
- Removed `std::time::Duration` import from `components.rs`, `resources.rs`, and `enemy.rs` as it was unnecessary. - Cleaned up imports in `systems.rs` by removing `FormationState`.
This commit is contained in:
parent
3c92823cb6
commit
4a64e12945
|
@ -1,5 +1,4 @@
|
|||
use bevy::prelude::*;
|
||||
use std::time::Duration; // Needed for Timer in Player
|
||||
|
||||
// --- Components ---
|
||||
#[derive(Component)]
|
||||
|
|
13
src/enemy.rs
13
src/enemy.rs
|
@ -2,16 +2,13 @@ use bevy::prelude::*;
|
|||
use std::time::Duration;
|
||||
|
||||
use crate::components::{Enemy, EnemyBullet, EnemyState, EnemyType, FormationTarget};
|
||||
use crate::constants::{ // Added WINDOW_WIDTH
|
||||
ENEMY_BULLET_PLAYER_COLLISION_THRESHOLD, ENEMY_BULLET_SIZE, ENEMY_BULLET_SPEED,
|
||||
ENEMY_SHOOT_INTERVAL, ENEMY_SIZE, ENEMY_SPEED, FORMATION_BASE_Y, FORMATION_COLS,
|
||||
FORMATION_ENEMY_COUNT, FORMATION_X_SPACING, FORMATION_Y_SPACING, WINDOW_HEIGHT, WINDOW_WIDTH,
|
||||
use crate::constants::{ // Only keeping used constants
|
||||
ENEMY_BULLET_SIZE, ENEMY_SIZE, ENEMY_SPEED, WINDOW_HEIGHT, WINDOW_WIDTH,
|
||||
};
|
||||
use crate::resources::{
|
||||
AttackDiveTimer, CurrentStage, EnemySpawnTimer, FormationState, PlayerLives,
|
||||
PlayerRespawnTimer, StageConfigurations, // Make sure StageConfigurations is imported if not already
|
||||
AttackDiveTimer, CurrentStage, EnemySpawnTimer, FormationState,
|
||||
StageConfigurations,
|
||||
};
|
||||
use crate::game_state::AppState;
|
||||
|
||||
pub fn spawn_enemies(
|
||||
mut commands: Commands,
|
||||
|
@ -278,8 +275,6 @@ pub fn trigger_attack_dives(
|
|||
|
||||
// Only proceed if the timer finished AND the formation is complete
|
||||
if timer.timer.just_finished() && formation_state.formation_complete {
|
||||
// Find all enemies currently in formation
|
||||
let mut available_enemies: Vec<Entity> = Vec::new();
|
||||
// Get the current stage config
|
||||
let config_index = (stage.number as usize - 1) % stage_configs.stages.len();
|
||||
let current_config = &stage_configs.stages[config_index];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use bevy::prelude::*;
|
||||
use std::time::Duration; // Needed for Timer
|
||||
|
||||
// --- Resources ---
|
||||
#[derive(Resource)]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use crate::components::{Invincible, Player};
|
||||
use crate::resources::{CurrentStage, FormationState, PlayerLives, Score};
|
||||
use crate::resources::{CurrentStage, PlayerLives, Score};
|
||||
use crate::player::spawn_player_ship; // Import the helper function
|
||||
|
||||
// --- Setup ---
|
||||
|
|
Loading…
Reference in a new issue