Catch-the-Button-2/Catch the button/AudioSystem.cs

39 lines
1.1 KiB
C#
Raw Normal View History

2021-05-28 12:32:22 +00:00
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 {
2021-05-30 15:39:37 +00:00
static SoundPlayer hit = new SoundPlayer();
static SoundPlayer miss = new SoundPlayer();
static SoundPlayer levelup = new SoundPlayer();
2021-05-30 19:47:54 +00:00
static SoundPlayer gamestart = new SoundPlayer();
2021-05-30 15:39:37 +00:00
static internal void Init() {
hit.SoundLocation = "./resources/hit.wav";
miss.SoundLocation = "./resources/miss.wav";
levelup.SoundLocation = "./resources/levelup.wav";
2021-05-30 19:47:54 +00:00
gamestart.SoundLocation = "./resources/game-start.wav";
hit.Load();
miss.Load();
levelup.Load();
gamestart.Load();
2021-05-30 15:39:37 +00:00
}
2021-05-28 12:32:22 +00:00
static internal void Hit() {
hit.Play();
}
static internal void Miss() {
miss.Play();
}
2021-05-30 15:39:37 +00:00
static internal void LevelUp() {
levelup.Play();
}
2021-05-30 19:47:54 +00:00
static internal void Play() {
gamestart.Play();
}
2021-05-28 12:32:22 +00:00
}
}