aboutsummaryrefslogtreecommitdiff
path: root/SuperPolarity/SuperPolarity.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2014-02-11 07:06:36 -0600
committerBen Beltran <ben@nsovocal.com>2014-02-11 07:06:36 -0600
commit2d3615a1fe7ea09e23da999090a8fbea19c5d646 (patch)
tree73427d2c33090d2d7229ad16c0c32ba716dcf227 /SuperPolarity/SuperPolarity.cs
parentd7a43ae2d3d4702bd199fa5d8ca84c7c6e78ed36 (diff)
Moves song to SoundEffect
Diffstat (limited to 'SuperPolarity/SuperPolarity.cs')
-rw-r--r--SuperPolarity/SuperPolarity.cs21
1 files changed, 11 insertions, 10 deletions
diff --git a/SuperPolarity/SuperPolarity.cs b/SuperPolarity/SuperPolarity.cs
index 12303a0..7fa387c 100644
--- a/SuperPolarity/SuperPolarity.cs
+++ b/SuperPolarity/SuperPolarity.cs
@@ -29,8 +29,8 @@ namespace SuperPolarity
Screen EntryScreen;
- protected Song TitleSong;
- protected Song GameSong;
+ protected SoundEffect GameSong;
+ protected SoundEffectInstance GameSongHandle;
protected SoundEffect GameOverSound;
public SuperPolarity()
@@ -39,6 +39,11 @@ namespace SuperPolarity
graphics = new GraphicsDeviceManager(this);
Components.Add(new GamerServicesComponent(this));
+ graphics.PreferMultiSampling = true;
+ graphics.PreferredBackBufferHeight = 720;
+ graphics.PreferredBackBufferWidth = 1280;
+ //graphics.ToggleFullScreen();
+
Content.RootDirectory = "Content";
ActorFactory.SetGame(this);
ParticleEffectFactory.SetGame(this);
@@ -58,11 +63,6 @@ namespace SuperPolarity
{
base.Initialize();
- graphics.PreferMultiSampling = true;
- graphics.PreferredBackBufferHeight = 720;
- graphics.PreferredBackBufferWidth = 1280;
- //graphics.ToggleFullScreen();
-
InputController.RegisterEventForKey("fullScreenToggle", Keys.F11);
InputController.Bind("fullScreenToggle", HandleFullScreenToggle);
@@ -85,7 +85,8 @@ namespace SuperPolarity
{
MediaPlayer.IsRepeating = true;
- GameSong = Content.Load<Song>("Sound\\polaritytheme");
+ GameSong = Content.Load<SoundEffect>("Sound\\polaritytheme");
+ GameSongHandle = GameSong.CreateInstance();
GameOverSound = Content.Load<SoundEffect>("Sound\\gameover");
// Create a new SpriteBatch, which can be used to draw textures.
@@ -144,7 +145,7 @@ namespace SuperPolarity
// temp stuff before media manager is in
if (songName == "game")
{
- MediaPlayer.Play(GameSong);
+ GameSongHandle.Play();
}
}
@@ -153,7 +154,7 @@ namespace SuperPolarity
var scoreScreen = new ScoreScreen(this);
scoreScreen.Initialize();
- MediaPlayer.Stop();
+ GameSongHandle.Stop();
GameOverSound.Play();
ScreenManager.Pop();
ScreenManager.Push(scoreScreen);