Remove audio entity after playing
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -102,9 +102,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "allocator-api2"
|
||||
version = "0.2.16"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
|
||||
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
|
||||
|
||||
[[package]]
|
||||
name = "alsa"
|
||||
|
||||
@@ -268,7 +268,7 @@ fn game_over_system(mut next_state: ResMut<NextState<AppState>>) {
|
||||
fn collision_sound_system(mut commands: Commands, audio_assets: Res<audio::Assets>) {
|
||||
commands.spawn(AudioBundle {
|
||||
source: audio_assets.collision.clone(),
|
||||
..Default::default()
|
||||
settings: PlaybackSettings::DESPAWN,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ fn blip_sound_system(
|
||||
for _ in eaten_event_reader.read() {
|
||||
commands.spawn(AudioBundle {
|
||||
source: audio_assets.blip.clone(),
|
||||
..Default::default()
|
||||
settings: PlaybackSettings::DESPAWN,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ pub(super) fn change_direction_system(
|
||||
commands.entity(snake).insert(NextDirection(new_direction));
|
||||
commands.spawn(AudioBundle {
|
||||
source: audio_assets.tick.clone(),
|
||||
..Default::default()
|
||||
settings: PlaybackSettings::DESPAWN,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user