Commits

Anonymous committed 5071877

First commit

Comments (0)

Files changed (27)

+syntax: glob
+*/obj/*
+*/bin/*
+tools/*
+*.user
+*.suo
+*/_ReSharper*/
+src/packages/*
+*.docstates
+build/*
+StyleCop.Cache
+*.vs10x
+*.orig
+*.dotCover
+*.csproj.Debug.cachefile

GameStateManagement.sln

+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameStateManagement", "GameStateManagement\GameStateManagement.csproj", "{CE4C1E0D-7E54-4BF6-9959-FB4BCC16B68E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameStateManagementContent", "GameStateManagementContent\GameStateManagementContent.contentproj", "{44459A75-F2CF-4B58-89EA-79154AF5C1AF}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x86 = Debug|x86
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{CE4C1E0D-7E54-4BF6-9959-FB4BCC16B68E}.Debug|x86.ActiveCfg = Debug|x86
+		{CE4C1E0D-7E54-4BF6-9959-FB4BCC16B68E}.Debug|x86.Build.0 = Debug|x86
+		{CE4C1E0D-7E54-4BF6-9959-FB4BCC16B68E}.Release|x86.ActiveCfg = Release|x86
+		{CE4C1E0D-7E54-4BF6-9959-FB4BCC16B68E}.Release|x86.Build.0 = Release|x86
+		{44459A75-F2CF-4B58-89EA-79154AF5C1AF}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{44459A75-F2CF-4B58-89EA-79154AF5C1AF}.Release|x86.ActiveCfg = Debug|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

GameStateManagement/Game.cs

+using GameStateManagement.Screens;
+using GameStateManagement.State;
+using Microsoft.Xna.Framework;
+
+namespace GameStateManagement
+{
+	public class GameStateManagementGame : Game
+	{
+		private GraphicsDeviceManager _graphics;
+		private ScreenManager _screenManager;
+
+		public GameStateManagementGame()
+		{
+			Content.RootDirectory = "Content";
+
+			_graphics = new GraphicsDeviceManager(this);
+
+			_screenManager = new ScreenManager(this);
+			Components.Add(_screenManager);
+
+			AddInitialScreens();
+		}
+
+		private void AddInitialScreens()
+		{
+			_screenManager.AddScreen(new BackgroundScreen());
+			_screenManager.AddScreen(new MainMenuScreen());
+		}
+
+		protected override void Draw(GameTime gameTime)
+		{
+			_graphics.GraphicsDevice.Clear(Color.Black);
+
+			base.Draw(gameTime);
+		}
+	}
+}

GameStateManagement/Game.ico

Added
New image

GameStateManagement/GameStateManagement.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{CE4C1E0D-7E54-4BF6-9959-FB4BCC16B68E}</ProjectGuid>
+    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>GameStateManagement</RootNamespace>
+    <AssemblyName>GameStateManagement</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <XnaPlatform>Windows</XnaPlatform>
+    <XnaProfile>Reach</XnaProfile>
+    <XnaCrossPlatformGroupID>7c3b1948-a64a-4afc-8fba-04cf3810f6a7</XnaCrossPlatformGroupID>
+    <XnaOutputType>Game</XnaOutputType>
+    <XapFilename>$(AssemblyName).xap</XapFilename>
+    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+    <XnaWindowsPhoneManifestTemplate>Properties\WMAppManifest.xml</XnaWindowsPhoneManifestTemplate>
+    <TileImage>Background.png</TileImage>
+    <TileTitle>GameStateManagementSample</TileTitle>
+    <ApplicationIcon>Game.ico</ApplicationIcon>
+    <Thumbnail>GameThumbnail.png</Thumbnail>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <OutputPath>bin\x86\Debug</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoStdLib>true</NoStdLib>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
+    <PlatformTarget>x86</PlatformTarget>
+    <XnaCompressContent>false</XnaCompressContent>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoStdLib>true</NoStdLib>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <DefineConstants>TRACE;WINDOWS</DefineConstants>
+    <PlatformTarget>x86</PlatformTarget>
+    <XnaCompressContent>true</XnaCompressContent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="Game.cs" />
+    <Compile Include="State\GameScreen.cs" />
+    <Compile Include="InputState.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="State\ScreenManager.cs" />
+    <Compile Include="State\ScreenState.cs" />
+    <Compile Include="Screens\BackgroundScreen.cs" />
+    <Compile Include="Screens\GameplayScreen.cs" />
+    <Compile Include="Screens\LoadingScreen.cs" />
+    <Compile Include="Screens\MainMenuScreen.cs" />
+    <Compile Include="Screens\MenuEntry.cs" />
+    <Compile Include="Screens\MenuScreen.cs" />
+    <Compile Include="Screens\MessageBoxScreen.cs" />
+    <Compile Include="Screens\OptionsMenuScreen.cs" />
+    <Compile Include="Screens\PauseMenuScreen.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Game.ico" />
+    <Content Include="GameThumbnail.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Input.Touch, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+    <Reference Include="mscorlib">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Core">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Xml">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Xml.Linq">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\GameStateManagementContent\GameStateManagementContent.contentproj">
+      <Project>{44459A75-F2CF-4B58-89EA-79154AF5C1AF}</Project>
+      <Name>Content</Name>
+      <XnaReferenceType>Content</XnaReferenceType>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+  <!--
+      To modify your build process, add your task inside one of the targets below and uncomment it. 
+      Other similar extension points exist, see Microsoft.Common.targets.
+      <Target Name="BeforeBuild">
+      </Target>
+      <Target Name="AfterBuild">
+      </Target>
+    -->
+</Project>

GameStateManagement/GameThumbnail.png

Added
New image

GameStateManagement/InputState.cs

+using Microsoft.Xna.Framework.Input;
+
+namespace GameStateManagement
+{
+	public class InputState
+	{
+		private KeyboardState _currentKeyboardState;
+		private KeyboardState _previousKeyboardState;
+
+		public void Update()
+		{
+			_previousKeyboardState = _currentKeyboardState;
+			_currentKeyboardState = Keyboard.GetState();
+		}
+
+		public bool IsKeyPressed(Keys key)
+		{
+			return _currentKeyboardState.IsKeyDown(key);
+		}
+
+		public bool IsNewKeyPress(Keys key)
+		{
+			return _currentKeyboardState.IsKeyDown(key) && _previousKeyboardState.IsKeyUp(key);
+		}
+	}
+}

GameStateManagement/Program.cs

+namespace GameStateManagement
+{
+#if WINDOWS || XBOX
+    static class Program
+    {
+        static void Main(string[] args)
+        {
+            using (var game = new GameStateManagementGame())
+                game.Run();
+        }
+    }
+#endif
+}

GameStateManagement/Properties/AssemblyInfo.cs

+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("GameStateManagementSample")]
+[assembly: AssemblyProduct("GameStateManagementSample")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type. Only Windows
+// assemblies support COM.
+[assembly: ComVisible(false)]
+
+// On Windows, the following GUID is for the ID of the typelib if this
+// project is exposed to COM. On other platforms, it unique identifies the
+// title storage container when deploying this assembly to the device.
+[assembly: Guid("f99275b9-6a0b-4935-acad-5c1f3fdd80a9")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]

GameStateManagement/Screens/BackgroundScreen.cs

+using System;
+using GameStateManagement.State;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameStateManagement.Screens
+{
+	public class BackgroundScreen : GameScreen
+	{
+		private ContentManager _content;
+		private Texture2D _backgroundTexture;
+
+		public BackgroundScreen()
+		{
+			TransitionOnDuration = TimeSpan.FromSeconds(0.5);
+			TransitionOffDuration = TimeSpan.FromSeconds(0.5);
+		}
+
+		public override void LoadContent()
+		{
+			if (_content == null)
+				_content = new ContentManager(ScreenManager.Game.Services, "Content");
+
+			_backgroundTexture = _content.Load<Texture2D>("background");
+		}
+
+		public override void UnloadContent()
+		{
+			_content.Unload();
+		}
+
+		public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
+		{
+			base.Update(gameTime, otherScreenHasFocus, false);
+		}
+		
+		public override void Draw(GameTime gameTime)
+		{
+			var spriteBatch = ScreenManager.SpriteBatch;
+			var viewport = ScreenManager.GraphicsDevice.Viewport;
+			var fullscreen = new Rectangle(0, 0, viewport.Width, viewport.Height);
+
+			spriteBatch.Begin();
+			spriteBatch.Draw(_backgroundTexture, fullscreen, new Color(TransitionAlpha, TransitionAlpha, TransitionAlpha));
+			spriteBatch.End();
+		}
+	}
+}

GameStateManagement/Screens/GameplayScreen.cs

+using System;
+using System.Threading;
+using GameStateManagement.State;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using GameStateManagement;
+
+namespace GameStateManagement.Screens
+{
+	public class GameplayScreen : GameScreen
+	{
+		private ContentManager _content;
+		private SpriteFont _gameFont;
+
+		private Vector2 _playerPosition = new Vector2(100, 100);
+		private Vector2 _enemyPosition = new Vector2(100, 100);
+		private Random _random = new Random();
+		private float _pauseAlpha;
+
+		public GameplayScreen()
+		{
+			TransitionOnDuration = TimeSpan.FromSeconds(1.5);
+			TransitionOffDuration = TimeSpan.FromSeconds(0.5);
+		}
+
+		public override void LoadContent()
+		{
+			if (_content == null)
+				_content = new ContentManager(ScreenManager.Game.Services, "Content");
+
+			_gameFont = _content.Load<SpriteFont>("gamefont");
+
+			Thread.Sleep(1000);
+
+			ScreenManager.Game.ResetElapsedTime();
+		}
+
+		public override void UnloadContent()
+		{
+			_content.Unload();
+		}
+
+		public override void HandleInput(GameTime gameTime, InputState input)
+		{
+			if (input == null)
+				throw new ArgumentNullException("input");
+
+			if (input.IsNewKeyPress(Keys.P) || input.IsNewKeyPress(Keys.Escape))
+			{
+				ScreenManager.AddScreen(new PauseMenuScreen());
+			}
+			else
+			{
+				var movement = Vector2.Zero;
+
+				if (input.IsKeyPressed(Keys.Left))
+					movement.X--;
+
+				if (input.IsKeyPressed(Keys.Right))
+					movement.X++;
+
+				if (input.IsKeyPressed(Keys.Up))
+					movement.Y--;
+
+				if (input.IsKeyPressed(Keys.Down))
+					movement.Y++;
+
+				if (movement.Length() > 1)
+					movement.Normalize();
+
+				_playerPosition += movement * 8f;
+			}
+		}
+
+		public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
+		{
+			base.Update(gameTime, otherScreenHasFocus, false);
+
+			if (coveredByOtherScreen)
+				_pauseAlpha = Math.Min(_pauseAlpha + 1f / 32, 1);
+			else
+				_pauseAlpha = Math.Max(_pauseAlpha - 1f / 32, 0);
+
+			if (!IsActive)
+				return;
+
+			const float randomization = 10;
+
+			_enemyPosition.X += (float)(_random.NextDouble() - 0.5) * randomization;
+			_enemyPosition.Y += (float)(_random.NextDouble() - 0.5) * randomization;
+
+			var targetPosition = new Vector2(
+				ScreenManager.GraphicsDevice.Viewport.Width / 2 - _gameFont.MeasureString("Insert Gameplay Here").X / 2,
+				200);
+
+			_enemyPosition = Vector2.Lerp(_enemyPosition, targetPosition, 0.05f);
+		}
+
+		public override void Draw(GameTime gameTime)
+		{
+			ScreenManager.GraphicsDevice.Clear(ClearOptions.Target, Color.CornflowerBlue, 0, 0);
+
+			var spriteBatch = ScreenManager.SpriteBatch;
+
+			spriteBatch.Begin();
+			spriteBatch.DrawString(_gameFont, "// TODO", _playerPosition, Color.Green);
+			spriteBatch.DrawString(_gameFont, "Insert Gameplay Here", _enemyPosition, Color.DarkRed);
+			spriteBatch.End();
+
+			if (TransitionPosition > 0 || _pauseAlpha > 0)
+			{
+				var alpha = MathHelper.Lerp(1f - TransitionAlpha, 1f, _pauseAlpha / 2);
+				ScreenManager.FadeBackBufferToBlack(alpha);
+			}
+		}
+	}
+}

GameStateManagement/Screens/LoadingScreen.cs

+using System;
+using GameStateManagement.State;
+using Microsoft.Xna.Framework;
+
+namespace GameStateManagement.Screens
+{
+	public class LoadingScreen : GameScreen
+	{
+		private bool _loadingIsSlow;
+		private bool _otherScreensAreGone;
+		private GameScreen[] _screensToLoad;
+
+		private LoadingScreen(bool loadingIsSlow, GameScreen[] screensToLoad)
+		{
+			_loadingIsSlow = loadingIsSlow;
+			_screensToLoad = screensToLoad;
+			TransitionOnDuration = TimeSpan.FromSeconds(0.5);
+		}
+
+		public static void Load(ScreenManager screenManager, bool loadingIsSlow, params GameScreen[] screensToLoad)
+		{
+			foreach (var screen in screenManager.GetScreens())
+				screen.ExitScreen();
+
+			var loadingScreen = new LoadingScreen(loadingIsSlow, screensToLoad);
+			screenManager.AddScreen(loadingScreen);
+		}
+
+		public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
+		{
+			base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
+
+			if (_otherScreensAreGone == false)
+				return;
+
+			ScreenManager.RemoveScreen(this);
+
+			foreach (var screen in _screensToLoad)
+			{
+				if (screen != null)
+				{
+					ScreenManager.AddScreen(screen);
+				}
+			}
+
+			ScreenManager.Game.ResetElapsedTime();
+		}
+
+		public override void Draw(GameTime gameTime)
+		{
+			if ((ScreenState == ScreenState.Active) && (ScreenManager.GetScreens().Length == 1))
+			{
+				_otherScreensAreGone = true;
+			}
+
+			if (_loadingIsSlow == false)
+				return;
+
+			var spriteBatch = ScreenManager.SpriteBatch;
+			var font = ScreenManager.Font;
+
+			const string message = "Loading...";
+
+			var viewport = ScreenManager.GraphicsDevice.Viewport;
+			var viewportSize = new Vector2(viewport.Width, viewport.Height);
+			var textSize = font.MeasureString(message);
+			var textPosition = (viewportSize - textSize) / 2;
+
+			var color = Color.White * TransitionAlpha;
+
+			spriteBatch.Begin();
+			spriteBatch.DrawString(font, message, textPosition, color);
+			spriteBatch.End();
+		}
+	}
+}

GameStateManagement/Screens/MainMenuScreen.cs

+using System;
+
+namespace GameStateManagement.Screens
+{
+	public class MainMenuScreen : MenuScreen
+	{
+		public MainMenuScreen()
+			: base("Main Menu")
+		{
+			var playGameMenuEntry = new MenuEntry("Play Game");
+			var optionsMenuEntry = new MenuEntry("Options");
+			var exitMenuEntry = new MenuEntry("Exit");
+
+			playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
+			optionsMenuEntry.Selected += OptionsMenuEntrySelected;
+			exitMenuEntry.Selected += OnCancel;
+
+			MenuEntries.Add(playGameMenuEntry);
+			MenuEntries.Add(optionsMenuEntry);
+			MenuEntries.Add(exitMenuEntry);
+		}
+
+		protected override void OnCancel()
+		{
+			const string message = "Running away eh? Thought you might.";
+
+			var confirmExitMessageBox = new MessageBoxScreen(message);
+
+			confirmExitMessageBox.Accepted += ConfirmExitMessageBoxAccepted;
+
+			ScreenManager.AddScreen(confirmExitMessageBox);
+		}
+
+		private void PlayGameMenuEntrySelected(object sender, EventArgs e)
+		{
+			LoadingScreen.Load(ScreenManager, true, new GameplayScreen());
+		}
+
+		private void OptionsMenuEntrySelected(object sender, EventArgs e)
+		{
+			ScreenManager.AddScreen(new OptionsMenuScreen());
+		}
+
+		private void ConfirmExitMessageBoxAccepted(object sender, EventArgs e)
+		{
+			ScreenManager.Game.Exit();
+		}
+	}
+}

GameStateManagement/Screens/MenuEntry.cs

+using System;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameStateManagement.Screens
+{
+	public class MenuEntry
+	{
+		public event EventHandler Selected;
+
+		private string _text;
+		private float _selectionFade;
+		private Vector2 _position;
+
+		public MenuEntry(string text)
+		{
+			_text = text;
+		}
+
+		public string Text
+		{
+			get { return _text; }
+			set { _text = value; }
+		}
+
+		public Vector2 Position
+		{
+			get { return _position; }
+			set { _position = value; }
+		}
+
+		protected internal virtual void OnSelectEntry()
+		{
+			var handler = Selected;
+			if (handler != null)
+				handler(this, EventArgs.Empty);
+		}
+
+		public virtual void Update(MenuScreen screen, bool isSelected, GameTime gameTime)
+		{
+			var fadeSpeed = (float)gameTime.ElapsedGameTime.TotalSeconds * 4;
+
+			if (isSelected)
+				_selectionFade = Math.Min(_selectionFade + fadeSpeed, 1);
+			else
+				_selectionFade = Math.Max(_selectionFade - fadeSpeed, 0);
+		}
+
+		public virtual void Draw(MenuScreen screen, bool isSelected, GameTime gameTime)
+		{
+			var color = isSelected ? Color.Yellow : Color.White;
+
+			var time = gameTime.TotalGameTime.TotalSeconds;
+			var pulsate = (float)Math.Sin(time * 6) + 1;
+			var scale = 1 + pulsate * 0.05f * _selectionFade;
+
+			color *= screen.TransitionAlpha;
+
+			var screenManager = screen.ScreenManager;
+			var spriteBatch = screenManager.SpriteBatch;
+			var font = screenManager.Font;
+
+			var origin = new Vector2(0, font.LineSpacing / 2);
+
+			spriteBatch.DrawString(font, _text, _position, color, 0, origin, scale, SpriteEffects.None, 0);
+		}
+
+		public virtual int GetHeight(MenuScreen screen)
+		{
+			return screen.ScreenManager.Font.LineSpacing;
+		}
+
+		public virtual int GetWidth(MenuScreen screen)
+		{
+			return (int)screen.ScreenManager.Font.MeasureString(Text).X;
+		}
+	}
+}

GameStateManagement/Screens/MenuScreen.cs

+using System;
+using System.Collections.Generic;
+using GameStateManagement.State;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using GameStateManagement;
+
+namespace GameStateManagement.Screens
+{
+	public abstract class MenuScreen : GameScreen
+	{
+		private List<MenuEntry> _menuEntries = new List<MenuEntry>();
+		private int _selectedEntry;
+		private string _menuTitle;
+
+		protected MenuScreen(string menuTitle)
+		{
+			_menuTitle = menuTitle;
+
+			TransitionOnDuration = TimeSpan.FromSeconds(0.5);
+			TransitionOffDuration = TimeSpan.FromSeconds(0.5);
+		}
+
+		protected IList<MenuEntry> MenuEntries
+		{
+			get { return _menuEntries; }
+		}
+		
+		public override void HandleInput(GameTime gameTime, InputState input)
+		{
+			if (input.IsNewKeyPress(Keys.Up))
+			{
+				_selectedEntry--;
+
+				if (_selectedEntry < 0)
+					_selectedEntry = _menuEntries.Count - 1;
+			}
+
+			if (input.IsNewKeyPress(Keys.Down))
+			{
+				_selectedEntry++;
+
+				if (_selectedEntry >= _menuEntries.Count)
+					_selectedEntry = 0;
+			}
+
+			if (input.IsNewKeyPress(Keys.Enter))
+			{
+				OnSelectEntry(_selectedEntry);
+			}
+			else if (input.IsNewKeyPress(Keys.Escape))
+			{
+				OnCancel();
+			}
+		}
+
+		protected virtual void OnSelectEntry(int entryIndex)
+		{
+			_menuEntries[entryIndex].OnSelectEntry();
+		}
+
+		protected virtual void OnCancel()
+		{
+			ExitScreen();
+		}
+
+		public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
+		{
+			base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
+
+			for (var i = 0; i < _menuEntries.Count; i++)
+			{
+				var isSelected = IsActive && (i == _selectedEntry);
+
+				_menuEntries[i].Update(this, isSelected, gameTime);
+			}
+		}
+
+		public override void Draw(GameTime gameTime)
+		{
+			UpdateMenuEntryLocations();
+
+			var graphics = ScreenManager.GraphicsDevice;
+			var spriteBatch = ScreenManager.SpriteBatch;
+			var font = ScreenManager.Font;
+
+			spriteBatch.Begin();
+
+			for (var i = 0; i < _menuEntries.Count; i++)
+			{
+				var menuEntry = _menuEntries[i];
+
+				var isSelected = IsActive && (i == _selectedEntry);
+
+				menuEntry.Draw(this, isSelected, gameTime);
+			}
+
+			var transitionOffset = (float)Math.Pow(TransitionPosition, 2);
+
+			var titlePosition = new Vector2(graphics.Viewport.Width / 2, 80);
+			var titleOrigin = font.MeasureString(_menuTitle) / 2;
+			var titleColor = new Color(192, 192, 192) * TransitionAlpha;
+			var titleScale = 1.25f;
+
+			titlePosition.Y -= transitionOffset * 100;
+
+			spriteBatch.DrawString(font, _menuTitle, titlePosition, titleColor, 0, titleOrigin, titleScale, SpriteEffects.None, 0);
+			spriteBatch.End();
+		}
+
+		protected void OnCancel(object sender, EventArgs e)
+		{
+			OnCancel();
+		}
+
+		protected virtual void UpdateMenuEntryLocations()
+		{
+			var transitionOffset = (float)Math.Pow(TransitionPosition, 2);
+
+			var position = new Vector2(0f, 175f);
+
+			for (var i = 0; i < _menuEntries.Count; i++)
+			{
+				var menuEntry = _menuEntries[i];
+
+				position.X = (ScreenManager.GraphicsDevice.Viewport.Width - menuEntry.GetWidth(this)) / 2;
+
+				if (ScreenState == ScreenState.TransitionOn)
+					position.X -= transitionOffset * 256;
+				else
+					position.X += transitionOffset * 512;
+
+				menuEntry.Position = position;
+				position.Y += menuEntry.GetHeight(this);
+			}
+		}
+	}
+}

GameStateManagement/Screens/MessageBoxScreen.cs

+using System;
+using GameStateManagement.State;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using GameStateManagement;
+
+namespace GameStateManagement.Screens
+{
+	public class MessageBoxScreen : GameScreen
+	{
+		public event EventHandler Accepted;
+		public event EventHandler Cancelled;
+
+		private string _message;
+		private Texture2D _gradientTexture;
+
+		public MessageBoxScreen(string message)
+			: this(message, true)
+		{ }
+
+		public MessageBoxScreen(string message, bool includeUsageText)
+		{
+			const string usageText = "\nSpace or Enter = ok\nEsc = cancel";
+
+			if (includeUsageText)
+				_message = message + usageText;
+			else
+				_message = message;
+
+			IsPopup = true;
+
+			TransitionOnDuration = TimeSpan.FromSeconds(0.2);
+			TransitionOffDuration = TimeSpan.FromSeconds(0.2);
+		}
+
+		public override void LoadContent()
+		{
+			var content = ScreenManager.Game.Content;
+			_gradientTexture = content.Load<Texture2D>("gradient");
+		}
+		
+		public override void HandleInput(GameTime gameTime, InputState input)
+		{
+			if (input.IsNewKeyPress(Keys.Space) || input.IsNewKeyPress(Keys.Enter))
+			{
+				if (Accepted != null)
+					Accepted(this, EventArgs.Empty);
+
+				ExitScreen();
+			}
+			else if (input.IsNewKeyPress(Keys.Escape) || input.IsNewKeyPress(Keys.Back))
+			{
+				if (Cancelled != null)
+					Cancelled(this, EventArgs.Empty);
+
+				ExitScreen();
+			}
+		}
+
+		public override void Draw(GameTime gameTime)
+		{
+			var spriteBatch = ScreenManager.SpriteBatch;
+			var font = ScreenManager.Font;
+
+			ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 2 / 3);
+
+			var viewport = ScreenManager.GraphicsDevice.Viewport;
+			var viewportSize = new Vector2(viewport.Width, viewport.Height);
+			var textSize = font.MeasureString(_message);
+			var textPosition = (viewportSize - textSize) / 2;
+
+			const int hPad = 32;
+			const int vPad = 16;
+
+			var backgroundRectangle = new Rectangle((int)textPosition.X - hPad,
+														  (int)textPosition.Y - vPad,
+														  (int)textSize.X + hPad * 2,
+														  (int)textSize.Y + vPad * 2);
+
+			var color = Color.White * TransitionAlpha;
+
+			spriteBatch.Begin();
+			spriteBatch.Draw(_gradientTexture, backgroundRectangle, color);
+			spriteBatch.DrawString(font, _message, textPosition, color);
+			spriteBatch.End();
+		}
+	}
+}

GameStateManagement/Screens/OptionsMenuScreen.cs

+using System;
+
+namespace GameStateManagement.Screens
+{
+	public class OptionsMenuScreen : MenuScreen
+	{
+		private MenuEntry _soundVolume;
+		private MenuEntry _musicVolumne;
+		private MenuEntry _difficulty;
+
+		private int _currentSoundVolume = 10;
+		private int _currentMusicVolume = 11;
+		private int _currentDifficulty;
+
+		private string[] _difficultyNames = new[] {"Namby pamby", "Sort of easy", "Nut job"};
+		
+		public OptionsMenuScreen()
+			: base("Options")
+		{
+			_soundVolume = new MenuEntry(string.Empty);
+			_musicVolumne = new MenuEntry(string.Empty);
+			_difficulty = new MenuEntry(string.Empty);
+
+			SetMenuEntryText();
+			
+			_soundVolume.Selected += SoundVolumeSelected;
+			_musicVolumne.Selected += MusicVolumneSelected;
+			_difficulty.Selected += DifficultySelected;
+
+			var back = new MenuEntry("Back");
+			back.Selected += OnCancel;
+
+			MenuEntries.Add(_soundVolume);
+			MenuEntries.Add(_musicVolumne);
+			MenuEntries.Add(_difficulty);
+			MenuEntries.Add(back);
+		}
+
+		private void SetMenuEntryText()
+		{
+			_soundVolume.Text = "Sound volumne: " + _currentSoundVolume;
+			_musicVolumne.Text = "Music volumne: " + _currentMusicVolume;
+			_difficulty.Text = "Difficulty: " + _difficultyNames[_currentDifficulty];
+		}
+
+		private void SoundVolumeSelected(object sender, EventArgs e)
+		{
+			_currentSoundVolume++;
+			SetMenuEntryText();
+		}
+
+		private void MusicVolumneSelected(object sender, EventArgs e)
+		{
+			_currentMusicVolume++;
+			SetMenuEntryText();
+		}
+
+		private void DifficultySelected(object sender, EventArgs e)
+		{
+			_currentDifficulty++;
+
+			if (_currentDifficulty > _difficultyNames.Length - 1)
+				_currentDifficulty = 0;
+
+			SetMenuEntryText();
+		}
+	}
+}

GameStateManagement/Screens/PauseMenuScreen.cs

+using System;
+
+namespace GameStateManagement.Screens
+{
+	public class PauseMenuScreen : MenuScreen
+	{
+		public PauseMenuScreen()
+			: base("Paused")
+		{
+			var resumeGameMenuEntry = new MenuEntry("Resume Game");
+			var quitGameMenuEntry = new MenuEntry("Quit Game");
+
+			resumeGameMenuEntry.Selected += OnCancel;
+			quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
+
+			MenuEntries.Add(resumeGameMenuEntry);
+			MenuEntries.Add(quitGameMenuEntry);
+		}
+
+		private void QuitGameMenuEntrySelected(object sender, EventArgs e)
+		{
+			const string message = "Don't worry. Games aren't for everyone. You go ahead and quit!";
+
+			var confirmQuitMessageBox = new MessageBoxScreen(message);
+
+			confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted;
+
+			ScreenManager.AddScreen(confirmQuitMessageBox);
+		}
+
+		private void ConfirmQuitMessageBoxAccepted(object sender, EventArgs e)
+		{
+			LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
+		}
+	}
+}

GameStateManagement/State/GameScreen.cs

+using System;
+using GameStateManagement;
+using Microsoft.Xna.Framework;
+
+namespace GameStateManagement.State
+{
+    public abstract class GameScreen
+    {
+    	private bool _otherScreenHasFocus;
+
+    	protected GameScreen()
+    	{
+    		ScreenState = ScreenState.TransitionOn;
+    		TransitionPosition = 1;
+    		TransitionOnDuration = TimeSpan.Zero;
+    		TransitionOffDuration = TimeSpan.Zero;
+    		IsPopup = false;
+    	}
+
+    	public bool IsPopup { get; protected set; }
+		public TimeSpan TransitionOffDuration { get; protected set; }
+		public TimeSpan TransitionOnDuration { get; protected set; }
+		public float TransitionPosition { get; protected set; }
+		
+		public ScreenState ScreenState { get; protected set; }
+		public ScreenManager ScreenManager { get; internal set; }
+    	public bool IsExiting { get; protected internal set; }
+
+    	public float TransitionAlpha
+    	{
+    		get { return 1f - TransitionPosition; }
+    	}
+
+    	public bool IsActive
+        {
+            get
+            {
+                return !_otherScreenHasFocus && (ScreenState == ScreenState.TransitionOn || ScreenState == ScreenState.Active);
+            }
+        }
+
+    	public virtual void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
+        {
+            _otherScreenHasFocus = otherScreenHasFocus;
+
+            if (IsExiting)
+            {
+                ScreenState = ScreenState.TransitionOff;
+
+                if (UpdateTransition(gameTime, TransitionOffDuration, 1) == false)
+                {
+                    ScreenManager.RemoveScreen(this);
+                }
+            }
+            else if (coveredByOtherScreen)
+            {
+                if (UpdateTransition(gameTime, TransitionOffDuration, 1))
+                {
+                    ScreenState = ScreenState.TransitionOff;
+                }
+                else
+                {
+                    ScreenState = ScreenState.Hidden;
+                }
+            }
+            else
+            {
+                if (UpdateTransition(gameTime, TransitionOnDuration, -1))
+                {
+                    ScreenState = ScreenState.TransitionOn;
+                }
+                else
+                {
+                    ScreenState = ScreenState.Active;
+                }
+            }
+        }
+		
+		public void ExitScreen()
+        {
+            if (TransitionOffDuration == TimeSpan.Zero)
+            {
+                ScreenManager.RemoveScreen(this);
+            }
+            else
+            {
+                IsExiting = true;
+            }
+        }
+
+		public virtual void LoadContent() { }
+		public virtual void UnloadContent() { }
+		public virtual void HandleInput(GameTime gameTime, InputState input) { }
+		public virtual void Draw(GameTime gameTime) { }
+
+    	private bool UpdateTransition(GameTime gameTime, TimeSpan duration, int direction)
+    	{
+    		float transitionDelta;
+
+    		if (duration == TimeSpan.Zero)
+    			transitionDelta = 1;
+    		else
+    			transitionDelta = (float)(gameTime.ElapsedGameTime.TotalMilliseconds / duration.TotalMilliseconds);
+
+    		TransitionPosition += transitionDelta * direction;
+
+    		if (((direction < 0) && (TransitionPosition <= 0)) || ((direction > 0) && (TransitionPosition >= 1)))
+    		{
+    			TransitionPosition = MathHelper.Clamp(TransitionPosition, 0, 1);
+    			return false;
+    		}
+
+    		return true;
+    	}
+    }
+}

GameStateManagement/State/ScreenManager.cs

+using System.Collections.Generic;
+using GameStateManagement;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameStateManagement.State
+{
+	public class ScreenManager : DrawableGameComponent
+	{
+		private List<GameScreen> _screens = new List<GameScreen>();
+		private List<GameScreen> _tempScreens = new List<GameScreen>();
+		private InputState _input = new InputState();
+		private bool _isInitialized;
+
+		public ScreenManager(Game game)
+			: base(game)
+		{
+		}
+
+		public SpriteBatch SpriteBatch { get; private set; }
+		public SpriteFont Font { get; private set; }
+		public Texture2D BlankTexture { get; private set; }
+
+		public override void Initialize()
+		{
+			base.Initialize();
+
+			_isInitialized = true;
+		}
+
+		protected override void LoadContent()
+		{
+			var content = Game.Content;
+
+			SpriteBatch = new SpriteBatch(GraphicsDevice);
+			Font = content.Load<SpriteFont>("menufont");
+			BlankTexture = content.Load<Texture2D>("blank");
+
+			foreach (var screen in _screens)
+			{
+				screen.LoadContent();
+			}
+		}
+		
+		protected override void UnloadContent()
+		{
+			foreach (var screen in _screens)
+			{
+				screen.UnloadContent();
+			}
+		}
+
+		public override void Update(GameTime gameTime)
+		{
+			_input.Update();
+
+			_tempScreens.Clear();
+
+			foreach (var screen in _screens)
+				_tempScreens.Add(screen);
+
+			var otherScreenHasFocus = !Game.IsActive;
+			var coveredByOtherScreen = false;
+
+			while (_tempScreens.Count > 0)
+			{
+				var screen = PopTopScreen();
+
+				screen.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
+
+				if (screen.ScreenState != ScreenState.TransitionOn && screen.ScreenState != ScreenState.Active) 
+					continue;
+
+				if (otherScreenHasFocus == false)
+				{
+					screen.HandleInput(gameTime, _input);
+					otherScreenHasFocus = true;
+				}
+
+				if (screen.IsPopup == false)
+					coveredByOtherScreen = true;
+			}
+		}
+
+		public override void Draw(GameTime gameTime)
+		{
+			foreach (var screen in _screens)
+			{
+				if (screen.ScreenState == ScreenState.Hidden)
+					continue;
+
+				screen.Draw(gameTime);
+			}
+		}
+
+		public void AddScreen(GameScreen screen)
+		{
+			screen.ScreenManager = this;
+			screen.IsExiting = false;
+
+			if (_isInitialized)
+			{
+				screen.LoadContent();
+			}
+
+			_screens.Add(screen);
+		}
+
+		public void RemoveScreen(GameScreen screen)
+		{
+			if (_isInitialized)
+			{
+				screen.UnloadContent();
+			}
+
+			_screens.Remove(screen);
+			_tempScreens.Remove(screen);
+		}
+
+		public GameScreen[] GetScreens()
+		{
+			return _screens.ToArray();
+		}
+
+		public void FadeBackBufferToBlack(float alpha)
+		{
+			SpriteBatch.Begin();
+			SpriteBatch.Draw(BlankTexture, GraphicsDevice.Viewport.Bounds, Color.Black * alpha);
+			SpriteBatch.End();
+		}
+
+		private GameScreen PopTopScreen()
+		{
+			var screen = _tempScreens[_tempScreens.Count - 1];
+			_tempScreens.RemoveAt(_tempScreens.Count - 1);
+			return screen;
+		}
+	}
+}

GameStateManagement/State/ScreenState.cs

+namespace GameStateManagement.State
+{
+	public enum ScreenState
+	{
+		TransitionOn,
+		Active,
+		TransitionOff,
+		Hidden,
+	}
+}

GameStateManagementContent/GameStateManagementContent.contentproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <ProjectGuid>{44459A75-F2CF-4B58-89EA-79154AF5C1AF}</ProjectGuid>
+    <ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
+    <ContentRootDirectory>Content</ContentRootDirectory>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RootNamespace>PhoneContent</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="background.png">
+      <Name>background</Name>
+      <Importer>TextureImporter</Importer>
+      <Processor>TextureProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="blank.png">
+      <Name>blank</Name>
+      <Importer>TextureImporter</Importer>
+      <Processor>TextureProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="menufont.spritefont">
+      <Name>menufont</Name>
+      <Importer>FontDescriptionImporter</Importer>
+      <Processor>FontDescriptionProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="gamefont.spritefont">
+      <Name>gamefont</Name>
+      <Importer>FontDescriptionImporter</Importer>
+      <Processor>FontDescriptionProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="gradient.png">
+      <Name>gradient</Name>
+      <Importer>TextureImporter</Importer>
+      <Processor>TextureProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL" />
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86" />
+  </ItemGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

GameStateManagementContent/background.png

Added
New image

GameStateManagementContent/blank.png

Added
New image

GameStateManagementContent/gamefont.spritefont

+<?xml version="1.0" encoding="utf-8"?>
+<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
+	<Asset Type="Graphics:FontDescription">
+		<FontName>Segoe UI</FontName>
+		<Size>32</Size>
+		<Spacing>2</Spacing>
+		<Style>Bold</Style>
+		<CharacterRegions>
+			<CharacterRegion>
+				<Start>&#32;</Start>
+				<End>&#126;</End>
+			</CharacterRegion>
+		</CharacterRegions>
+	</Asset>
+</XnaContent>

GameStateManagementContent/gradient.png

Added
New image

GameStateManagementContent/menufont.spritefont

+<?xml version="1.0" encoding="utf-8"?>
+<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
+	<Asset Type="Graphics:FontDescription">
+		<FontName>Segoe UI Mono</FontName>
+		<Size>20</Size>
+		<Spacing>2</Spacing>
+		<Style>Regular</Style>
+		<CharacterRegions>
+			<CharacterRegion>
+				<Start>&#32;</Start>
+				<End>&#126;</End>
+			</CharacterRegion>
+		</CharacterRegions>
+	</Asset>
+</XnaContent>