Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 8138476

Browse files
committed
feat: add hit wall sound effect
1 parent b6894c5 commit 8138476

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

Assets/Sounds/HitWall.wav

21.6 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
None
1111

12+
## 24.7.0
13+
14+
## Added
15+
16+
- More sound effects
17+
18+
## Changed
19+
20+
- Optimize default recognition parameters
21+
22+
## 24.6.0
23+
24+
## Added
25+
26+
- Error logging
27+
- More sound effects
28+
29+
## Removed
30+
31+
- Scanning cameras
32+
1233
## 24.5.0
1334

1435
## Added

Source/Game.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ public static readonly (long Min, long Max) OrderDeliveryDurationRange = (
215215
);
216216
private static bool _isSoundDischargingPlaying = false;
217217

218+
private static readonly SoundPlayer _soundHitWall = new SoundPlayer(
219+
@"Assets/Sounds/HitWall.wav"
220+
);
221+
private static bool _isSoundHitWallPlaying = false;
222+
218223
private static readonly SoundPlayer _soundAutoCharge = new SoundPlayer(
219224
@"Assets/Sounds/AutoCharge.wav"
220225
);
@@ -405,6 +410,7 @@ public Game()
405410
Game._soundNotMoving.Load();
406411
Game._soundSetChargingPile.Load();
407412
Game._soundTakeOrder.Load();
413+
Game._soundHitWall.Load();
408414

409415
// Generate barriers
410416
this._barrierList = new List<Barrier>();
@@ -813,9 +819,21 @@ void ScoreHittingWall()
813819

814820
if (this.IsInWall(vehiclePosition))
815821
{
822+
if (!Game._isSoundHitWallPlaying) {
823+
Game._soundHitWall.Play();
824+
Game._isSoundHitWallPlaying = true;
825+
}
826+
816827
this._score[(CampType)this._camp] +=
817828
Game.ScoreHittingWallRate * this.LastTickDuration;
818829
}
830+
else
831+
{
832+
if (Game._isSoundHitWallPlaying) {
833+
Game._isSoundHitWallPlaying = false;
834+
Game._soundHitWall.Stop();
835+
}
836+
}
819837
}
820838

821839
/// <summary>

Source/MainWindow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public partial class MainWindow : Form
4949
{
5050
Locator = new LocatorConfigType
5151
{
52-
Hue = (5, 25),
53-
Saturation = (120, 255),
54-
Value = (50, 255),
52+
Hue = (45, 60),
53+
Saturation = (80, 255),
54+
Value = (80, 255),
5555
MinArea = 4M
5656
},
5757
ShowMask = false,

0 commit comments

Comments
 (0)