(
game_state_spawning: &mut WaveManagerStateSpawning,
dt: f32,
enemies: &mut Vec<Enemy>,
resources: &Resources,
sound_mixer: &mut SoundMixer,
)
| 130 | } |
| 131 | |
| 132 | fn update_state_spawning( |
| 133 | game_state_spawning: &mut WaveManagerStateSpawning, |
| 134 | dt: f32, |
| 135 | enemies: &mut Vec<Enemy>, |
| 136 | resources: &Resources, |
| 137 | sound_mixer: &mut SoundMixer, |
| 138 | ) -> Option<WaveManagerCommand> { |
| 139 | game_state_spawning.spawn_timer += dt; |
| 140 | if game_state_spawning.spawn_timer > ENEMY_SPAWN_TIME { |
| 141 | game_state_spawning.enemies_left -= 1; |
| 142 | game_state_spawning.spawn_timer -= ENEMY_SPAWN_TIME; |
| 143 | spawn_enemy( |
| 144 | enemies, |
| 145 | resources, |
| 146 | SpawnBlueprint::Normal, |
| 147 | EnemyColor::random(), |
| 148 | ); |
| 149 | resources.play_sound(SoundIdentifier::Spawn, sound_mixer, Volume(0.4f32)); |
| 150 | } |
| 151 | if game_state_spawning.enemies_left <= 0 { |
| 152 | return Some(WaveManagerCommand::ChangeState(WaveManagerState::Battle)); |
| 153 | } |
| 154 | None |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | pub enum SpawnBlueprint { |
nothing calls this directly
no test coverage detected