Add ship thruster sound
The player's Ship now has an AudioPlayer component constantly looping a thruster sound effect. It starts paused and is only resumed when the player fires the thruster. As noted in the TODO comment at the top of the input_ship_thruster(...) system, I need to figure out if I want to start using the `Single<>` query parameter instead of a `Query<>` and then doing my own null-ability checks (like what it does now).
This commit is contained in:
@@ -168,6 +168,12 @@ pub fn spawn_player(mut commands: Commands, game_assets: Res<GameAssets>) {
|
||||
Mesh2d(game_assets.ship().0),
|
||||
MeshMaterial2d(game_assets.ship().1),
|
||||
Transform::default().with_scale(Vec3::new(20.0, 20.0, 20.0)),
|
||||
AudioPlayer::new(game_assets.ship_thruster_sound()),
|
||||
PlaybackSettings {
|
||||
mode: bevy::audio::PlaybackMode::Loop,
|
||||
paused: true,
|
||||
..Default::default()
|
||||
},
|
||||
))
|
||||
.with_child((
|
||||
Mesh2d(game_assets.thruster_mesh()),
|
||||
|
||||
Reference in New Issue
Block a user