]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - SuperPolarity/SuperPolarity.cs
Update project to work on VS Code mac
[rbdr/super-polarity] / SuperPolarity / SuperPolarity.cs
index f5ff48eb7f8655be759875f699e979ca91a19b44..f644fa6449d69608537f74291e61c492a9516628 100644 (file)
@@ -1,20 +1,18 @@
-#region Using Statements
-using System;
-using System.Collections.Generic;
+#region Using Statements
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Content;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Content;
 using Microsoft.Xna.Framework.Graphics;
 using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Storage;
 using Microsoft.Xna.Framework.GamerServices;
 using Microsoft.Xna.Framework.GamerServices;
-using Microsoft.Xna.Framework.Media;
 using Microsoft.Xna.Framework.Audio;
 using SuperPolarity;
 using Microsoft.Xna.Framework.Audio;
 using SuperPolarity;
-using Tao.Sdl;
 #endregion
 
 namespace SuperPolarity
 {
 #endregion
 
 namespace SuperPolarity
 {
+
+       using MediaPlayer = Microsoft.Xna.Framework.Media.MediaPlayer;
+
     /// <summary>
     /// This is the main type for your game
     /// </summary>
     /// <summary>
     /// This is the main type for your game
     /// </summary>
@@ -29,8 +27,8 @@ namespace SuperPolarity
 
         Screen EntryScreen;
 
 
         Screen EntryScreen;
 
-        protected Song TitleSong;
-        protected Song GameSong;
+        protected SoundEffect GameSong;
+        protected SoundEffectInstance GameSongHandle;
         protected SoundEffect GameOverSound;
 
         public SuperPolarity()
         protected SoundEffect GameOverSound;
 
         public SuperPolarity()
@@ -40,9 +38,9 @@ namespace SuperPolarity
             Components.Add(new GamerServicesComponent(this));
 
             graphics.PreferMultiSampling = true;
             Components.Add(new GamerServicesComponent(this));
 
             graphics.PreferMultiSampling = true;
-            graphics.PreferredBackBufferWidth = 1280;
             graphics.PreferredBackBufferHeight = 720;
             graphics.PreferredBackBufferHeight = 720;
-            //graphics.ToggleFullScreen();
+            graphics.PreferredBackBufferWidth = 1280;
+                       //graphics.ToggleFullScreen();
 
             Content.RootDirectory = "Content";
             ActorFactory.SetGame(this);
 
             Content.RootDirectory = "Content";
             ActorFactory.SetGame(this);
@@ -85,7 +83,8 @@ namespace SuperPolarity
         {
 
             MediaPlayer.IsRepeating = true;
         {
 
             MediaPlayer.IsRepeating = true;
-            GameSong = Content.Load<Song>("Sound\\polaritytheme.wav");
+            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.
             GameOverSound = Content.Load<SoundEffect>("Sound\\gameover");
 
             // Create a new SpriteBatch, which can be used to draw textures.
@@ -144,7 +143,7 @@ namespace SuperPolarity
             // temp stuff before media manager is in
             if (songName == "game")
             {
             // temp stuff before media manager is in
             if (songName == "game")
             {
-                MediaPlayer.Play(GameSong);
+                GameSongHandle.Play();
             }
         }
 
             }
         }
 
@@ -153,7 +152,7 @@ namespace SuperPolarity
             var scoreScreen = new ScoreScreen(this);
             scoreScreen.Initialize();
 
             var scoreScreen = new ScoreScreen(this);
             scoreScreen.Initialize();
 
-            MediaPlayer.Stop();
+            GameSongHandle.Stop();
             GameOverSound.Play();
             ScreenManager.Pop();
             ScreenManager.Push(scoreScreen);
             GameOverSound.Play();
             ScreenManager.Pop();
             ScreenManager.Push(scoreScreen);