enemy formations

Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2025-04-11 10:51:05 +02:00
parent 0b8527b955
commit c525b376b0
4 changed files with 241 additions and 91 deletions

View file

@ -12,9 +12,9 @@ pub mod stage;
pub mod systems;
use constants::{PLAYER_RESPAWN_DELAY, STARTING_LIVES, WINDOW_HEIGHT, WINDOW_WIDTH};
use resources::{
use resources::{ // Added StageConfigurations
AttackDiveTimer, CurrentStage, EnemySpawnTimer, FormationState, PlayerLives,
PlayerRespawnTimer, Score,
PlayerRespawnTimer, Score, StageConfigurations,
};
use game_state::{
cleanup_game_entities, cleanup_game_over_ui, setup_game_over_ui, AppState,
@ -69,6 +69,14 @@ fn main() {
total_spawned_this_stage: 0,
formation_complete: false,
})
.insert_resource(StageConfigurations::default()) // Add stage configurations
.insert_resource(AttackDiveTimer {
timer: { // Correctly assign the block expression to the timer field
let mut timer = Timer::new(Duration::from_secs_f32(3.0), TimerMode::Repeating); // Default duration, will be overwritten by stage config
timer.pause(); // Start paused
timer
}
})
.insert_resource(AttackDiveTimer {
timer: {
let mut timer = Timer::new(Duration::from_secs_f32(3.0), TimerMode::Repeating);