-#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;
#endregion
namespace SuperPolarity
{
+
+ using MediaPlayer = Microsoft.Xna.Framework.Media.MediaPlayer;
+
/// <summary>
/// This is the main type for your game
/// </summary>
Screen EntryScreen;
- protected Song TitleSong;
- protected Song GameSong;
+ protected SoundEffect GameSong;
+ protected SoundEffectInstance GameSongHandle;
protected SoundEffect GameOverSound;
public SuperPolarity()
Components.Add(new GamerServicesComponent(this));
graphics.PreferMultiSampling = true;
- graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
- graphics.ToggleFullScreen();
+ graphics.PreferredBackBufferWidth = 1280;
+ //graphics.ToggleFullScreen();
Content.RootDirectory = "Content";
ActorFactory.SetGame(this);
{
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.
// temp stuff before media manager is in
if (songName == "game")
{
- MediaPlayer.Play(GameSong);
+ GameSongHandle.Play();
}
}
var scoreScreen = new ScoreScreen(this);
scoreScreen.Initialize();
- MediaPlayer.Stop();
+ GameSongHandle.Stop();
GameOverSound.Play();
ScreenManager.Pop();
ScreenManager.Push(scoreScreen);