Skip to content

Commit

Permalink
⚡ Replace tesla loop with zap sound
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrijnbeek committed Nov 27, 2023
1 parent 34e7ca7 commit 1673216
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Bearded.TD.Game.Simulation.Elements.events;
using Bearded.TD.Game.Simulation.GameObjects;
using Bearded.TD.Game.Simulation.Weapons;
using Bearded.TD.Shared.Events;
Expand Down Expand Up @@ -26,5 +27,6 @@ public override void Update(TimeSpan elapsedTime) { }
public void HandleEvent(FireWeapon e)
{
EmitArc(e.Damage, range.GetTilesInRange());
Events.Send(new EmittedArc());
}
}
6 changes: 6 additions & 0 deletions src/Bearded.TD/Game/Simulation/Elements/events/EmittedArc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using Bearded.TD.Game.Simulation.GameObjects;

namespace Bearded.TD.Game.Simulation.Elements.events;

[Trigger("emittedArc")]
readonly record struct EmittedArc : IComponentEvent;
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
}
},
{
id: "loopSoundWhileShooting",
parameters: { sound: "tesla-loop" },
id: "playSoundOnTrigger",
parameters: {
trigger: "emittedArc",
sound: "hit-electricity",
},
}
]
}
2 changes: 2 additions & 0 deletions src/Bearded.TD/assets/mods/default/sfx/attribution.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shots/hit-electricity
- uses sample by newlocknew - https://creativecommons.org/licenses/by/4.0/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
id: "hit-electricity",
pitchRange: [0.9, 1.1],
}
Binary file not shown.

0 comments on commit 1673216

Please sign in to comment.