Music klasser erstellt und eingebaut.

This commit is contained in:
Wafa Sadri
2014-05-12 12:59:43 +02:00
parent 094d989b84
commit f5dd6c868d
5 changed files with 37 additions and 1 deletions

30
src/Music.cs Normal file
View File

@@ -0,0 +1,30 @@
using System;
using System.Media;
namespace WorldOfPeacecraft
{
public class Music
{
string musicpath = "./music/";
string soundpath = "./sounds/";
SoundPlayer overworldplayer = new SoundPlayer(musicpath + "overworld.wav");
SoundPlayer minigameplayer = new SoundPlayer(musicpath + "minigame.wav");
SoundPlayer splashscreenplayer = new SoundPlayer (soundpath + "splashscreen.wav");
SoundPlayer walkplayer = new SoundPlayer(soundpath + "step.wav");
public Music ()
{
}
public void Playmusic (string sound){
if (sound == "overworld")
overworldplayer.PlayLooping ();
if (sound == "minigame")
minigameplayer.PlayLooping ();
if (sound == "splashscreen")
splashscreenplayer.PlaySync ();
if (sound == "walk")
walkplayer.Play ();
}
}
}