X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/6fceaa7b34f4d6efc497cda51679b37e530a61aa..9ad526c0233134a928cb5889dccb94458fc6dfd0:/SuperPolarity/SuperPolarity.cs?ds=inline diff --git a/SuperPolarity/SuperPolarity.cs b/SuperPolarity/SuperPolarity.cs index 6b2b9d5..f644fa6 100644 --- a/SuperPolarity/SuperPolarity.cs +++ b/SuperPolarity/SuperPolarity.cs @@ -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.Storage; using Microsoft.Xna.Framework.GamerServices; -using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Audio; using SuperPolarity; -using Tao.Sdl; #endregion namespace SuperPolarity { + + using MediaPlayer = Microsoft.Xna.Framework.Media.MediaPlayer; + /// /// This is the main type for your game /// @@ -29,8 +27,8 @@ namespace SuperPolarity Screen EntryScreen; - protected Song TitleSong; - protected Song GameSong; + protected SoundEffect GameSong; + protected SoundEffectInstance GameSongHandle; protected SoundEffect GameOverSound; public SuperPolarity() @@ -39,6 +37,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 +61,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 +83,8 @@ namespace SuperPolarity { MediaPlayer.IsRepeating = true; - GameSong = Content.Load("Sound\\polaritytheme.wav"); + GameSong = Content.Load("Sound\\polaritytheme"); + GameSongHandle = GameSong.CreateInstance(); GameOverSound = Content.Load("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") { - MediaPlayer.Play(GameSong); + GameSongHandle.Play(); } } @@ -153,7 +152,7 @@ namespace SuperPolarity var scoreScreen = new ScoreScreen(this); scoreScreen.Initialize(); - MediaPlayer.Stop(); + GameSongHandle.Stop(); GameOverSound.Play(); ScreenManager.Pop(); ScreenManager.Push(scoreScreen);