diff --git a/scenes/debug_lvl.tscn b/scenes/debug_lvl.tscn index 45c3f1d..8bb653a 100644 --- a/scenes/debug_lvl.tscn +++ b/scenes/debug_lvl.tscn @@ -66,3 +66,7 @@ position = Vector2(848, 254) _line = 3 [connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"] +[connection signal="OnHPChanged" from="Zombie" to="Zombie/AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="Zombie2" to="Zombie2/AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="Zombie3" to="Zombie3/AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="Zombie4" to="Zombie4/AudioStreamPlayer2D" method="OnHPChanged"] diff --git a/scenes/entities/Zombies/zombie.tscn b/scenes/entities/Zombies/zombie.tscn index c26b14e..07e9287 100644 --- a/scenes/entities/Zombies/zombie.tscn +++ b/scenes/entities/Zombies/zombie.tscn @@ -213,6 +213,6 @@ stream = ExtResource("8_di4dd") script = ExtResource("9_oxd1e") [connection signal="OnHPChanged" from="." to="CanvasGroup" method="DamageFlash"] -[connection signal="OnHPChanged" from="." to="AudioStreamPlayer2D" method="OnHPChanged"] +[connection signal="OnHPChanged" from="." to="AudioStreamPlayer2D" method="OnDamaged"] [connection signal="area_entered" from="Eatbox" to="Eatbox" method="OnAreaEntered"] [connection signal="area_exited" from="Eatbox" to="Eatbox" method="OnAreaExited"] diff --git a/scripts/components/zombies/AudioDamage.cs b/scripts/components/zombies/AudioDamage.cs index da814e7..30ac389 100644 --- a/scripts/components/zombies/AudioDamage.cs +++ b/scripts/components/zombies/AudioDamage.cs @@ -3,7 +3,7 @@ using System; public partial class AudioDamage : AudioStreamPlayer2D { - public void OnHPChanged(int amount) + public void OnDamaged(int amount) { Play(); }