diff --git a/.vs/Catch the button/v16/.suo b/.vs/Catch the button/v16/.suo
index 7b0edee..8c0e8f1 100644
Binary files a/.vs/Catch the button/v16/.suo and b/.vs/Catch the button/v16/.suo differ
diff --git a/Catch the button/AudioSystem.cs b/Catch the button/AudioSystem.cs
new file mode 100644
index 0000000..c66ff7c
--- /dev/null
+++ b/Catch the button/AudioSystem.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Media;
+
+namespace Catch_the_button {
+ class AudioSystem {
+ static SoundPlayer hit = new SoundPlayer("./resources/hit.wav");
+ static SoundPlayer miss = new SoundPlayer("./resources/miss.wav");
+ static internal void Hit() {
+ hit.Play();
+ }
+ static internal void Miss() {
+ miss.Play();
+ }
+ }
+}
diff --git a/Catch the button/Catch the button.csproj b/Catch the button/Catch the button.csproj
index 674aa36..0ce84b2 100644
--- a/Catch the button/Catch the button.csproj
+++ b/Catch the button/Catch the button.csproj
@@ -61,6 +61,7 @@
+
Form
diff --git a/Catch the button/Game.cs b/Catch the button/Game.cs
index 12738a4..b953515 100644
--- a/Catch the button/Game.cs
+++ b/Catch the button/Game.cs
@@ -75,7 +75,6 @@ namespace Catch_the_button {
btn.Location = new Point((frm.Width - btn.Width) / 2, (frm.Height - btn.Height) / 2);
status = true;
timer.Interval = delay;
-
}
static void Go() { //first button hit
timer.Start();
@@ -87,22 +86,27 @@ namespace Catch_the_button {
if (!status) return;
if (first) {
Go();
+ points++;
+ AudioSystem.Hit();
first = false;
return;
}
if (stpwch.ElapsedMilliseconds < 500 && !(obj is Form || obj is System.Timers.Timer)) {
+ AudioSystem.Hit();
points += 2;
if (points % milestoneCount == 0 && delay > 400) {
delay -= delaydown;
}
}
else if (stpwch.ElapsedMilliseconds >= 500 && !(obj is Form || obj is System.Timers.Timer)) {
+ AudioSystem.Hit();
points++;
if (points % milestoneCount == 0 && delay > 400) {
delay -= delaydown;
}
}
else if (obj is System.Timers.Timer || obj is Form) {
+ AudioSystem.Miss();
points--;
miss++;
formResetter.Start();
diff --git a/Catch the button/bin/Debug/Catch the button.exe b/Catch the button/bin/Debug/Catch the button.exe
index 575574a..89afadd 100644
Binary files a/Catch the button/bin/Debug/Catch the button.exe and b/Catch the button/bin/Debug/Catch the button.exe differ
diff --git a/Catch the button/bin/Debug/Catch the button.pdb b/Catch the button/bin/Debug/Catch the button.pdb
index 11b98c3..3be34de 100644
Binary files a/Catch the button/bin/Debug/Catch the button.pdb and b/Catch the button/bin/Debug/Catch the button.pdb differ
diff --git a/Catch the button/bin/Debug/resources/hit.wav b/Catch the button/bin/Debug/resources/hit.wav
new file mode 100644
index 0000000..c971180
Binary files /dev/null and b/Catch the button/bin/Debug/resources/hit.wav differ
diff --git a/Catch the button/bin/Debug/resources/miss.wav b/Catch the button/bin/Debug/resources/miss.wav
new file mode 100644
index 0000000..4a03253
Binary files /dev/null and b/Catch the button/bin/Debug/resources/miss.wav differ
diff --git a/Catch the button/obj/Debug/Catch the button.csproj.CoreCompileInputs.cache b/Catch the button/obj/Debug/Catch the button.csproj.CoreCompileInputs.cache
index 9e5c1af..8238313 100644
--- a/Catch the button/obj/Debug/Catch the button.csproj.CoreCompileInputs.cache
+++ b/Catch the button/obj/Debug/Catch the button.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-4ec7a7f8cafda8845629d58d71d67896e75d37b3
+348d5ad308b3803dddd051ec17e7b10c11b6970d
diff --git a/Catch the button/obj/Debug/Catch the button.exe b/Catch the button/obj/Debug/Catch the button.exe
index 575574a..89afadd 100644
Binary files a/Catch the button/obj/Debug/Catch the button.exe and b/Catch the button/obj/Debug/Catch the button.exe differ
diff --git a/Catch the button/obj/Debug/Catch the button.pdb b/Catch the button/obj/Debug/Catch the button.pdb
index 11b98c3..3be34de 100644
Binary files a/Catch the button/obj/Debug/Catch the button.pdb and b/Catch the button/obj/Debug/Catch the button.pdb differ
diff --git a/Catch the button/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Catch the button/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
index 476f246..692e1b0 100644
Binary files a/Catch the button/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Catch the button/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ