Audio: switch, fusion

This commit is contained in:
Pascal Engélibert 2022-08-24 14:51:49 +02:00
commit ec7d04c8c8
3 changed files with 21 additions and 4 deletions

View file

@ -14,7 +14,9 @@ use bevy_rapier2d::prelude::*;
pub enum AudioMsg {
Color([f32; 3]),
Fusion,
Jump,
Switch,
}
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
@ -199,7 +201,6 @@ fn collision_event_system(
Ok((c2_color, c2_transform, c2_player))) =
(character_query.get(*e1), character_query.get(*e2))
{
// TODO completely remove particles
commands.entity(*e1).despawn_recursive();
commands.entity(*e2).despawn_recursive();
@ -235,6 +236,8 @@ fn collision_event_system(
true,
);
}
audio.send(AudioMsg::Fusion).ok();
}
}
}
@ -276,7 +279,7 @@ fn change_character_system(
audio
.send(AudioMsg::Color([color.0.r(), color.0.g(), color.0.b()]))
.ok();
audio.send(AudioMsg::Jump).ok();
audio.send(AudioMsg::Switch).ok();
}
player_count += 1;