Browse Source

Merge branch 'master' of github.com:CartBlanche/MonoGame-Samples

Dean Ellis 13 years ago
parent
commit
f76a4a9468
65 changed files with 280 additions and 5156 deletions
  1. 4 4
      Samples/MacOS/CollisionSample/Program.cs
  2. 4 4
      Samples/MacOS/PerPixelCollisionSample/Program.cs
  3. 4 4
      Samples/MacOS/RenderTarget2DSample/Program.cs
  4. 8 2
      Samples/iOS/Catapults/Info.plist
  5. 12 2
      Samples/iOS/Catapults/Main.cs
  6. 31 30
      Samples/iOS/Catapults/MonoGame.Samples.CatapultWars.csproj
  7. 172 170
      Samples/iOS/Draw2D/Game1.cs
  8. 6 5
      Samples/iOS/Draw2D/MonoGame.Samples.Draw2D.csproj
  9. 3 4
      StarterKits/MacOS/Marblets/Program.cs
  10. 3 3
      StarterKits/MacOS/Platformer/Program.cs
  11. 0 10
      StarterKits/MonoGame.StarterKits.iOS.sln
  12. 3 32
      StarterKits/iOS/AlienGame/AlienGame.csproj
  13. 3 4
      StarterKits/iOS/AlienGame/main.cs
  14. 4 23
      StarterKits/iOS/Cards/BlackJack.iOS.csproj
  15. 1 12
      StarterKits/iOS/Cards/CardsFramework.iOS.csproj
  16. 4 7
      StarterKits/iOS/Cards/Program.iOS.cs
  17. 3 32
      StarterKits/iOS/Marblets/Marblets.csproj
  18. 3 4
      StarterKits/iOS/Marblets/Program.cs
  19. BIN
      StarterKits/iOS/MemoryMadness/.DS_Store
  20. BIN
      StarterKits/iOS/MemoryMadness/Content/Fonts/GameplayLargeFont.xnb
  21. BIN
      StarterKits/iOS/MemoryMadness/Content/Fonts/GameplaySmallFont.xnb
  22. BIN
      StarterKits/iOS/MemoryMadness/Content/Fonts/HighScoresFont.xnb
  23. BIN
      StarterKits/iOS/MemoryMadness/Content/Fonts/MenuFont.xnb
  24. 0 105
      StarterKits/iOS/MemoryMadness/Content/GamePlay/LevelDefinitions.xml
  25. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/BlueButton.wav
  26. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/DefeatBuzzer.wav
  27. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/GreenButton.wav
  28. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/HighScoreScreen.wav
  29. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/LevelComplete.wav
  30. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/RedButton.wav
  31. BIN
      StarterKits/iOS/MemoryMadness/Content/Sounds/YellowButton.wav
  32. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/Instructions.png
  33. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/Resuming.png
  34. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/blank.png
  35. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/gameplayBG.png
  36. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/leftDoor.png
  37. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/rightDoor.png
  38. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/titleBG.png
  39. BIN
      StarterKits/iOS/MemoryMadness/Content/Textures/ButtonStates.png
  40. BIN
      StarterKits/iOS/MemoryMadness/Default.png
  41. 0 8
      StarterKits/iOS/MemoryMadness/Info.plist
  42. 0 220
      StarterKits/iOS/MemoryMadness/MemoryMadness.csproj
  43. 0 276
      StarterKits/iOS/MemoryMadness/MemoryMadnessGame.cs
  44. 0 275
      StarterKits/iOS/MemoryMadness/Misc/AudioManager.cs
  45. 0 600
      StarterKits/iOS/MemoryMadness/Misc/Level.cs
  46. 0 97
      StarterKits/iOS/MemoryMadness/Misc/Settings.cs
  47. 0 34
      StarterKits/iOS/MemoryMadness/PhoneApplicationService.cs
  48. 0 27
      StarterKits/iOS/MemoryMadness/Program.cs
  49. 0 394
      StarterKits/iOS/MemoryMadness/ScreenManager/GameScreen.cs
  50. 0 237
      StarterKits/iOS/MemoryMadness/ScreenManager/InputState.cs
  51. 0 186
      StarterKits/iOS/MemoryMadness/ScreenManager/MenuEntry.cs
  52. 0 259
      StarterKits/iOS/MemoryMadness/ScreenManager/MenuScreen.cs
  53. 0 42
      StarterKits/iOS/MemoryMadness/ScreenManager/PlayerIndexEventArgs.cs
  54. 0 453
      StarterKits/iOS/MemoryMadness/ScreenManager/ScreenManager.cs
  55. 0 174
      StarterKits/iOS/MemoryMadness/Screens/BackgroundScreen.cs
  56. 0 454
      StarterKits/iOS/MemoryMadness/Screens/GameplayScreen.cs
  57. 0 279
      StarterKits/iOS/MemoryMadness/Screens/HighScoreScreen.cs
  58. 0 196
      StarterKits/iOS/MemoryMadness/Screens/LoadingAndInstructionsScreen.cs
  59. 0 100
      StarterKits/iOS/MemoryMadness/Screens/MainMenuScreen.cs
  60. 0 89
      StarterKits/iOS/MemoryMadness/Screens/NewGameSubMenu.cs
  61. 0 257
      StarterKits/iOS/MemoryMadness/Screens/PauseScreen.cs
  62. BIN
      StarterKits/iOS/MemoryMadness/xnatouchicon.png
  63. 3 32
      StarterKits/iOS/Platformer/Platformer.csproj
  64. 5 3
      StarterKits/iOS/Platformer/Program.cs
  65. 4 7
      StarterKits/iOS/VectorRumble/Program.cs

+ 4 - 4
Samples/MacOS/CollisionSample/Program.cs

@@ -46,12 +46,12 @@ namespace CollisionSample
 	
 	class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
 	{
-		
+		CollisionSample game;
 		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
 		{
-			using (CollisionSample game = new CollisionSample()) {
-				game.Run ();
-			}
+			game = new CollisionSample();
+			game.Run ();
+
 		}
 		
 		public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)

+ 4 - 4
Samples/MacOS/PerPixelCollisionSample/Program.cs

@@ -36,12 +36,12 @@ namespace PerPixelCollision
 	
 	class AppDelegate : NSApplicationDelegate
 	{
-		
+		PerPixelCollisionGame game;
 		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
 		{
-			using (PerPixelCollisionGame game = new PerPixelCollisionGame()) {
-				game.Run ();
-			}
+			game = new PerPixelCollisionGame();
+			game.Run ();
+
 		}
 		
 		public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)

+ 4 - 4
Samples/MacOS/RenderTarget2DSample/Program.cs

@@ -24,12 +24,12 @@ namespace RenderTarget2DSample
 	
 	class AppDelegate : NSApplicationDelegate
 	{
-		
+		Game1 game;
 		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
 		{
-			using (Game1 game = new Game1 ()) {
-				game.Run ();
-			}
+			game = new Game1 ();
+			game.Run ();
+
 		}
 		
 		public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)

+ 8 - 2
Samples/iOS/Catapults/Info.plist

@@ -2,10 +2,16 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>CFBundleDisplayName</key>
+	<string>Catapult Wars</string>
+	<key>MinimumOSVersion</key>
+	<string>4.3</string>
+	<key>UIDeviceFamily</key>
+	<array>
+		<integer>2</integer>
+	</array>
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationPortraitUpsideDown</string>
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>

+ 12 - 2
Samples/iOS/Catapults/Main.cs

@@ -4,10 +4,20 @@ using System.Linq;
 using MonoTouch.Foundation;
 using MonoTouch.UIKit;
 
-namespace Catapults
+namespace CatapultGame
 {
-	public class Application
+	[Register ("AppDelegate")]
+	class Program : UIApplicationDelegate 
 	{
+		private CatapultGame game;
+
+		public override void FinishedLaunching (UIApplication app)
+		{
+			// Fun begins..
+			game = new CatapultGame();
+			game.Run();
+		}
+		
 		// This is the main entry point of the application.
 		static void Main (string[] args)
 		{

+ 31 - 30
Samples/iOS/Catapults/MonoGame.Samples.CatapultWars.csproj

@@ -23,6 +23,7 @@
     <MtouchDebug>true</MtouchDebug>
     <MtouchProfiling>true</MtouchProfiling>
     <MtouchLink>None</MtouchLink>
+    <MtouchI18n />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
     <DebugType>none</DebugType>
@@ -92,36 +93,6 @@
     <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Ammo\rock_ammo.xnb">
       <Link>Content\Textures\Ammo\rock_ammo.xnb</Link>
     </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\blank.xnb">
-      <Link>Content\Textures\Backgrounds\blank.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\cloud1.xnb">
-      <Link>Content\Textures\Backgrounds\cloud1.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\cloud2.xnb">
-      <Link>Content\Textures\Backgrounds\cloud2.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\defeat.xnb">
-      <Link>Content\Textures\Backgrounds\defeat.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <Link>Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\instructions.xnb">
-      <Link>Content\Textures\Backgrounds\instructions.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\mountain.xnb">
-      <Link>Content\Textures\Backgrounds\mountain.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\sky.xnb">
-      <Link>Content\Textures\Backgrounds\sky.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\title_screen.xnb">
-      <Link>Content\Textures\Backgrounds\title_screen.xnb</Link>
-    </None>
-    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\victory.xnb">
-      <Link>Content\Textures\Backgrounds\victory.xnb</Link>
-    </None>
     <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\AnimationsDef.xml">
       <Link>Content\Textures\Catapults\AnimationsDef.xml</Link>
     </None>
@@ -236,6 +207,36 @@
     <Content Include="..\..\MacOS\CatapaultWars\Background.png">
       <Link>Background.png</Link>
     </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\blank.xnb">
+      <Link>Content\Textures\Backgrounds\blank.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\cloud1.xnb">
+      <Link>Content\Textures\Backgrounds\cloud1.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\cloud2.xnb">
+      <Link>Content\Textures\Backgrounds\cloud2.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\defeat.xnb">
+      <Link>Content\Textures\Backgrounds\defeat.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\gameplay_screen.xnb">
+      <Link>Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\instructions.xnb">
+      <Link>Content\Textures\Backgrounds\instructions.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\mountain.xnb">
+      <Link>Content\Textures\Backgrounds\mountain.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\sky.xnb">
+      <Link>Content\Textures\Backgrounds\sky.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\title_screen.xnb">
+      <Link>Content\Textures\Backgrounds\title_screen.xnb</Link>
+    </Content>
+    <Content Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\victory.xnb">
+      <Link>Content\Textures\Backgrounds\victory.xnb</Link>
+    </Content>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.iOS.csproj">

+ 172 - 170
Samples/iOS/Draw2D/Game1.cs

@@ -1,170 +1,172 @@
-using System;
-using System.Collections.Generic;
-
-#if ANDROID
-using Android.App;
-#endif
-
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Storage;
-
-namespace Microsoft.Xna.Samples.Draw2D
-{
-	/// <summary>
-	/// This is the main type for your game
-	/// </summary>
-	public class Game1 : Microsoft.Xna.Framework.Game
-	{
-		GraphicsDeviceManager graphics;
-		SpriteBatch spriteBatch;		
-		Texture2D texture, ball;
-		SpriteFont font;
-		float size, rotation;
-		float clippingSize = 0.0f;
-		Color alphaColor = Color.White;
-		FPSCounterComponent fps;
-		
-        public Game1 ()  
-		{
-			graphics = new GraphicsDeviceManager (this);
-			
-			Content.RootDirectory = "Content";
-			
-			graphics.PreferMultiSampling = true;
-			graphics.IsFullScreen = true;
-
-			graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight | DisplayOrientation.PortraitUpsideDown;
-		}
-		
-		/// <summary>
-		/// Allows the game to perform any initialization it needs to before starting to run.
-		/// This is where it can query for any required services and load any non-graphic
-		/// related content.  Calling base.Initialize will enumerate through any components
-		/// and initialize them as well.
-		/// </summary>
-		protected override void Initialize ()
-		{
-			// TODO: Add your initialization logic here
-
-			base.Initialize ();
-		}
-
-		/// <summary>
-		/// LoadContent will be called once per game and is the place to load
-		/// all of your content.
-		/// </summary>
-		protected override void LoadContent ()
-		{
-			// Create a new SpriteBatch, which can be used to draw textures.
-			spriteBatch = new SpriteBatch (GraphicsDevice);
-
-			// TODO: use this.Content to load your game content here
-			texture = Content.Load<Texture2D> ("monogameicon");
-			// TODO ball = Content.Load<Texture2D> ("purpleBall.xnb");
-			font = Content.Load<SpriteFont> ("spriteFont1");
-
-			fps = new FPSCounterComponent (this,spriteBatch,font);
-			Components.Add(fps);
-		}
-
-		/// <summary>
-		/// Allows the game to run logic such as updating the world,
-		/// checking for collisions, gathering input, and playing audio.
-		/// </summary>
-		/// <param name="gameTime">Provides a snapshot of timing values.</param>
-		protected override void Update (GameTime gameTime)
-		{
-			// TODO: Add your update logic here
-
-			size += 0.5f;
-			if (size > 150) {
-				size = 0;
-			}
-
-			rotation += 0.1f;
-			if (rotation > MathHelper.TwoPi) {
-				rotation = 0.0f;
-			}
-
-			clippingSize += 0.5f;
-			if (clippingSize > graphics.GraphicsDevice.Viewport.Width) {
-				clippingSize = 0.0f;
-			}
-
-			alphaColor.A ++;
-
-			base.Update (gameTime);
-		}
-
-		/// <summary>
-		/// This is called when the game should draw itself.
-		/// </summary>
-		/// <param name="gameTime">Provides a snapshot of timing values.</param>
-		protected override void Draw (GameTime gameTime)
-		{
-			graphics.GraphicsDevice.Clear (Color.CornflowerBlue);
-            
-			// Draw without blend
-			spriteBatch.Begin (SpriteSortMode.Deferred, BlendState.Opaque);			
-			spriteBatch.Draw (texture, new Vector2 (250,20), Color.White);	
-			spriteBatch.End ();
-
-			// Draw with additive blend
-			spriteBatch.Begin (SpriteSortMode.Deferred, BlendState.Additive);
-			spriteBatch.Draw (texture, new Vector2 (250,110), Color.White);
-			spriteBatch.Draw (texture, new Vector2 (260,120), Color.White);
-			spriteBatch.End ();
-            
-			spriteBatch.Begin ();
-
-			// Normal draw
-			// TODO spriteBatch.Draw (ball, new Vector2 (200,300), Color.White);	
-			// TODO spriteBatch.Draw (ball, new Vector2 (200,300), null, Color.Yellow, 0.0f, new Vector2 (5,5), 1.0f, SpriteEffects.None, 0);	
-            
-			// Normal draw
-			spriteBatch.Draw (texture, new Vector2 (10,390), Color.White);		
-			// Draw stretching
-			spriteBatch.Draw (texture, new Rectangle (0,0,(int)size,(int)size), Color.White);	
-			// Draw with Filter Color
-			spriteBatch.Draw (texture, new Vector2 (120,120), Color.Red);
-			// Draw rotated
-			spriteBatch.Draw (texture, new Rectangle (100,300,texture.Width,texture.Height), null, Color.White, rotation, new Vector2 (texture.Width / 2,texture.Height / 2), SpriteEffects.None, 0);	
-			// Draw texture section
-			spriteBatch.Draw (texture, new Vector2 (200,200), new Rectangle (20,20,40,40), Color.White);		
-			// Draw texture section and scale
-			spriteBatch.Draw (texture, new Rectangle (10,120,(int)size,(int)size), new Rectangle (20,20,40,40), Color.White);		
-			// Alpha blending
-			spriteBatch.Draw (texture, new Vector2 (140,0), alphaColor);	
-			// Flip horizontaly
-			spriteBatch.Draw (texture, new Rectangle (80,390,texture.Width,texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.FlipHorizontally, 0);	
-			// Flip verticaly
-			spriteBatch.Draw (texture, new Rectangle (150,390,texture.Width,texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.FlipVertically, 0);	
-			// Flip horizontaly and verticaly
-			spriteBatch.Draw (texture, new Rectangle (220,390,texture.Width,texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically, 0);	
-            
-			base.Draw (gameTime);
-
-			spriteBatch.End ();
-
-
-            
-			// Now let's try some scissoring
-			spriteBatch.Begin ();
-
-			spriteBatch.GraphicsDevice.ScissorRectangle = new Rectangle (50, 40, (int)clippingSize, (int)clippingSize);
-			spriteBatch.GraphicsDevice.RasterizerState.ScissorTestEnable = true;
-
-			spriteBatch.Draw (texture, new Rectangle (50, 40, 320, 40), Color.White);
-			spriteBatch.DrawString (font, "Scissor Clipping Test", new Vector2 (50, 40), Color.Red);
-			
-			spriteBatch.End ();
-
-            spriteBatch.GraphicsDevice.RasterizerState.ScissorTestEnable = false;
-            
-
-		}
-	}
-}
+using System;
+using System.Collections.Generic;
+
+#if ANDROID
+using Android.App;
+#endif
+
+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;
+
+namespace Microsoft.Xna.Samples.Draw2D
+{
+	/// <summary>
+	/// This is the main type for your game
+	/// </summary>
+	public class Game1 : Microsoft.Xna.Framework.Game
+	{
+		GraphicsDeviceManager graphics;
+		SpriteBatch spriteBatch;		
+		Texture2D texture, ball;
+		SpriteFont font;
+		float size, rotation;
+		float clippingSize = 0.0f;
+		Color alphaColor = Color.White;
+		FPSCounterComponent fps;
+		
+        public Game1 ()  
+		{
+			graphics = new GraphicsDeviceManager (this);
+			
+			Content.RootDirectory = "Content";
+			
+			graphics.PreferMultiSampling = true;
+			graphics.IsFullScreen = true;
+			
+			graphics.PreferredBackBufferHeight = 480;
+			graphics.PreferredBackBufferWidth = 320;
+
+			graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight | DisplayOrientation.PortraitUpsideDown;			
+		}
+		
+		/// <summary>
+		/// Allows the game to perform any initialization it needs to before starting to run.
+		/// This is where it can query for any required services and load any non-graphic
+		/// related content.  Calling base.Initialize will enumerate through any components
+		/// and initialize them as well.
+		/// </summary>
+		protected override void Initialize ()
+		{
+			// TODO: Add your initialization logic here
+
+			base.Initialize ();
+		}
+
+		/// <summary>
+		/// LoadContent will be called once per game and is the place to load
+		/// all of your content.
+		/// </summary>
+		protected override void LoadContent ()
+		{
+			// Create a new SpriteBatch, which can be used to draw textures.
+			spriteBatch = new SpriteBatch (GraphicsDevice);
+
+			// TODO: use this.Content to load your game content here
+			texture = Content.Load<Texture2D> ("monogameicon");
+			// TODO ball = Content.Load<Texture2D> ("purpleBall.xnb");
+			font = Content.Load<SpriteFont> ("spriteFont1");
+
+			fps = new FPSCounterComponent (this,spriteBatch,font);
+			Components.Add(fps);
+		}
+
+		/// <summary>
+		/// Allows the game to run logic such as updating the world,
+		/// checking for collisions, gathering input, and playing audio.
+		/// </summary>
+		/// <param name="gameTime">Provides a snapshot of timing values.</param>
+		protected override void Update (GameTime gameTime)
+		{
+			// TODO: Add your update logic here
+			size += 0.5f;
+			if (size > 150) {
+				size = 0;
+			}
+
+			rotation += 0.1f;
+			if (rotation > MathHelper.TwoPi) {
+				rotation = 0.0f;
+			}
+
+			clippingSize += 0.5f;
+			if (clippingSize > graphics.GraphicsDevice.Viewport.Width) {
+				clippingSize = 0.0f;
+			}
+
+			alphaColor.A ++;
+
+			base.Update (gameTime);
+		}
+
+		/// <summary>
+		/// This is called when the game should draw itself.
+		/// </summary>
+		/// <param name="gameTime">Provides a snapshot of timing values.</param>
+		protected override void Draw (GameTime gameTime)
+		{
+			graphics.GraphicsDevice.Clear (Color.CornflowerBlue);
+            
+			// Draw without blend
+			spriteBatch.Begin (SpriteSortMode.Deferred, BlendState.Opaque);			
+			spriteBatch.Draw (texture, new Vector2 (250,20), Color.White);	
+			spriteBatch.End ();
+
+			// Draw with additive blend
+			spriteBatch.Begin (SpriteSortMode.Deferred, BlendState.Additive);
+			spriteBatch.Draw (texture, new Vector2 (250,110), Color.White);
+			spriteBatch.Draw (texture, new Vector2 (260,120), Color.White);
+			spriteBatch.End ();
+            
+			spriteBatch.Begin ();
+
+			// Normal draw
+			// TODO spriteBatch.Draw (ball, new Vector2 (200,300), Color.White);	
+			// TODO spriteBatch.Draw (ball, new Vector2 (200,300), null, Color.Yellow, 0.0f, new Vector2 (5,5), 1.0f, SpriteEffects.None, 0);	
+            
+			// Normal draw
+			spriteBatch.Draw (texture, new Vector2 (10,390), Color.White);		
+			// Draw stretching
+			spriteBatch.Draw (texture, new Rectangle (0,0,(int)size,(int)size), Color.White);	
+			// Draw with Filter Color
+			spriteBatch.Draw (texture, new Vector2 (120,120), Color.Red);
+			// Draw rotated
+			spriteBatch.Draw (texture, new Rectangle (100,300,texture.Width,texture.Height), null, Color.White, rotation, new Vector2 (texture.Width / 2,texture.Height / 2), SpriteEffects.None, 0);	
+			// Draw texture section
+			spriteBatch.Draw (texture, new Vector2 (200,200), new Rectangle (20,20,40,40), Color.White);		
+			// Draw texture section and scale
+			spriteBatch.Draw (texture, new Rectangle (10,120,(int)size,(int)size), new Rectangle (20,20,40,40), Color.White);		
+			// Alpha blending
+			spriteBatch.Draw (texture, new Vector2 (140,0), alphaColor);	
+			// Flip horizontaly
+			spriteBatch.Draw (texture, new Rectangle (80,390,texture.Width,texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.FlipHorizontally, 0);	
+			// Flip verticaly
+			spriteBatch.Draw (texture, new Rectangle (150,390,texture.Width,texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.FlipVertically, 0);	
+			// Flip horizontaly and verticaly
+			spriteBatch.Draw (texture, new Rectangle (220,390,texture.Width,texture.Height), null, Color.White, 0.0f, Vector2.Zero, SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically, 0);	
+            
+			base.Draw (gameTime);
+
+			spriteBatch.End ();
+            
+			// Now let's try some scissoring
+			spriteBatch.Begin ();
+
+			spriteBatch.GraphicsDevice.ScissorRectangle = new Rectangle (50, 40, (int)clippingSize, (int)clippingSize);
+			spriteBatch.GraphicsDevice.RasterizerState.ScissorTestEnable = true;
+
+			spriteBatch.Draw (texture, new Rectangle (50, 40, 320, 40), Color.White);
+			spriteBatch.DrawString (font, "Scissor Clipping Test", new Vector2 (50, 40), Color.Red);
+			
+			spriteBatch.End ();
+
+            spriteBatch.GraphicsDevice.RasterizerState.ScissorTestEnable = false;
+            
+
+		}
+	}
+}

+ 6 - 5
Samples/iOS/Draw2D/MonoGame.Samples.Draw2D.csproj

@@ -15,7 +15,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
+    <DefineConstants>DEBUG;TEST1_1</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
@@ -39,7 +39,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
+    <DefineConstants>DEBUG;TEST1_1</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchDebug>true</MtouchDebug>
@@ -60,6 +60,7 @@
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
     <MtouchUseArmv7>false</MtouchUseArmv7>
     <AssemblyName>Draw2D</AssemblyName>
+    <DefineConstants>IPHONE</DefineConstants>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>none</DebugType>
@@ -92,15 +93,15 @@
     <Content Include="Content\purpleBall.xnb">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
-    <Content Include="Content\SpriteFont1.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
     <Content Include="Default.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <Content Include="Content\monogameicon.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="Content\spriteFont1.xnb">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>

+ 3 - 4
StarterKits/MacOS/Marblets/Program.cs

@@ -23,12 +23,11 @@ namespace Marblets
 	
 	class AppDelegate : NSApplicationDelegate
 	{
-		
+		MarbletsGame game;
 		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
 		{
-			using (MarbletsGame game = new MarbletsGame ()) {
-				game.Run ();
-			}
+			game = new MarbletsGame ();
+			game.Run ();
 		}
 		
 		public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)

+ 3 - 3
StarterKits/MacOS/Platformer/Program.cs

@@ -18,11 +18,11 @@ namespace Platformer
 	
 	class AppDelegate : NSApplicationDelegate
 	{
+		PlatformerGame game;
 		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
 		{			
-			using (PlatformerGame game = new PlatformerGame()) {
-				game.Run ();
-			}
+			game = new PlatformerGame();
+			game.Run ();
 		}
 		
 		public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)

+ 0 - 10
StarterKits/MonoGame.StarterKits.iOS.sln

@@ -19,8 +19,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardsFramework.iOS", "iOS\C
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VectorRumble.iOS", "iOS\VectorRumble\VectorRumble.iOS.csproj", "{1112251F-412F-443D-AA19-BDB5FA6B3CBA}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MemoryMadness", "iOS\MemoryMadness\MemoryMadness.csproj", "{296EBAC0-9658-474D-9A9E-5A8F52BA316F}"
-EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|iPhoneSimulator = Debug|iPhoneSimulator
@@ -45,14 +43,6 @@ Global
 		{1B9C099B-3958-4E11-A178-1E3B6ED34FC7}.Release|iPhone.Build.0 = Release|iPhone
 		{1B9C099B-3958-4E11-A178-1E3B6ED34FC7}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
 		{1B9C099B-3958-4E11-A178-1E3B6ED34FC7}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Debug|iPhone.ActiveCfg = Debug|iPhone
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Debug|iPhone.Build.0 = Debug|iPhone
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Release|iPhone.ActiveCfg = Release|iPhone
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Release|iPhone.Build.0 = Release|iPhone
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
-		{296EBAC0-9658-474D-9A9E-5A8F52BA316F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
 		{734EAA48-F1CA-481A-B391-0285BC0E8B40}.Debug|iPhone.ActiveCfg = Debug|Any CPU
 		{734EAA48-F1CA-481A-B391-0285BC0E8B40}.Debug|iPhone.Build.0 = Debug|Any CPU
 		{734EAA48-F1CA-481A-B391-0285BC0E8B40}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU

+ 3 - 32
StarterKits/iOS/AlienGame/AlienGame.csproj

@@ -9,7 +9,6 @@
     <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <OutputType>Exe</OutputType>
     <AssemblyName>AlienGame</AssemblyName>
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
     <RootNamespace>AlienGame</RootNamespace>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
@@ -21,13 +20,9 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
     <DebugType>none</DebugType>
@@ -35,14 +30,9 @@
     <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
     <DefineConstants>IPHONE;TARGET_IPHONE_SIMULATOR</DefineConstants>
     <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
     <DebugSymbols>true</DebugSymbols>
@@ -52,15 +42,11 @@
     <DefineConstants>DEBUG;IPHONE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <CodesignKey>iPhone Developer</CodesignKey>
     <MtouchI18n />
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
     <DebugType>none</DebugType>
@@ -68,40 +54,25 @@
     <OutputPath>bin\iPhone\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
     <DefineConstants>IPHONE</DefineConstants>
     <CodesignKey>iPhone Developer</CodesignKey>
     <MtouchI18n />
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug</OutputPath>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Release</OutputPath>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
@@ -232,7 +203,7 @@
     </Content>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\..\MonoGame.Framework\MonoGame.Framework.iOS.csproj">
+    <ProjectReference Include="..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.iOS.csproj">
       <Project>{DB8508BB-9849-4CC2-BC0F-8EB5DACB3C47}</Project>
       <Name>MonoGame.Framework.iOS</Name>
     </ProjectReference>

+ 3 - 4
StarterKits/iOS/AlienGame/main.cs

@@ -16,13 +16,12 @@ namespace AlienGameSample
     [Register ("AppDelegate")]
 	class Program : UIApplicationDelegate 
 	{
+		private AlienGame game;
 		public override void FinishedLaunching (UIApplication app)
 		{
 			// Fun begins..
-			using (AlienGame game = new AlienGame())
-            {
-                game.Run();
-            }
+			game = new AlienGame();
+            game.Run();
 			
 			//MediaLibrary lib = new MediaLibrary();
 			//object result = lib.Playlists;

+ 4 - 23
StarterKits/iOS/Cards/BlackJack.iOS.csproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
@@ -10,7 +10,6 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>BlackJack.iOS</RootNamespace>
     <AssemblyName>BlackJackiOS</AssemblyName>
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
     <DebugSymbols>true</DebugSymbols>
@@ -21,12 +20,8 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
+    <MtouchDebug>true</MtouchDebug>
     <ConsolePause>false</ConsolePause>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchArch>ARMv6</MtouchArch>
     <MtouchI18n />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
@@ -36,12 +31,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
     <ConsolePause>false</ConsolePause>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchArch>ARMv6</MtouchArch>
     <DefineConstants>IOS</DefineConstants>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
@@ -52,13 +42,9 @@
     <DefineConstants>DEBUG;IOS</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <CodesignKey>iPhone Developer</CodesignKey>
     <ConsolePause>false</ConsolePause>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchArch>ARMv6</MtouchArch>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
     <DebugType>none</DebugType>
@@ -66,13 +52,8 @@
     <OutputPath>bin\iPhone\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <ConsolePause>false</ConsolePause>
     <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchArch>ARMv6</MtouchArch>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <DefineConstants>IOS</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
@@ -83,7 +64,6 @@
     <Reference Include="OpenTK" />
   </ItemGroup>
   <ItemGroup>
-    <Content Include="Info.plist" />
     <Content Include="..\..\MacOS\Cards\CardsGame\Background.png">
       <Link>Background.png</Link>
     </Content>
@@ -330,6 +310,7 @@
     <Content Include="..\..\MacOS\Cards\BlackjackLoDefContent\Fonts\Regular.xnb">
       <Link>Content\Fonts\Regular.xnb</Link>
     </Content>
+    <None Include="Info.plist" />
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>

+ 1 - 12
StarterKits/iOS/Cards/CardsFramework.iOS.csproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +10,6 @@
     <OutputType>Library</OutputType>
     <RootNamespace>CardsFramework.iOS</RootNamespace>
     <AssemblyName>CardsFramework.iOS</AssemblyName>
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
@@ -20,12 +19,7 @@
     <DefineConstants>DEBUG</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
     <ConsolePause>false</ConsolePause>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
@@ -33,12 +27,7 @@
     <OutputPath>bin\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchDebug>False</MtouchDebug>
     <ConsolePause>false</ConsolePause>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />

+ 4 - 7
StarterKits/iOS/Cards/Program.iOS.cs

@@ -14,16 +14,13 @@ namespace Blackjack
     [Register ("AppDelegate")]
 	class Program : UIApplicationDelegate 
 	{
+		private BlackjackGame game;
+		
 		public override void FinishedLaunching (UIApplication app)
 		{
 			// Fun begins..
-			using (BlackjackGame game = new BlackjackGame())
-            {
-                game.Run();
-            }
-			
-			//MediaLibrary lib = new MediaLibrary();
-			//object result = lib.Playlists;
+			game = new BlackjackGame();
+            game.Run();
 		}
 
 		static void Main (string [] args)

+ 3 - 32
StarterKits/iOS/Marblets/Marblets.csproj

@@ -10,7 +10,6 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Marblets</RootNamespace>
     <AssemblyName>Marblets</AssemblyName>
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
     <Thumbnail>GameThumbnail.png</Thumbnail>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
@@ -22,13 +21,9 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
     <DebugType>none</DebugType>
@@ -36,14 +31,9 @@
     <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
     <DefineConstants>IPHONE</DefineConstants>
     <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
     <DebugSymbols>true</DebugSymbols>
@@ -53,14 +43,10 @@
     <DefineConstants>DEBUG;IPHONE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <MtouchI18n />
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
     <DebugType>none</DebugType>
@@ -68,40 +54,25 @@
     <OutputPath>bin\iPhone\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
     <DefineConstants>IPHONE</DefineConstants>
     <MtouchI18n />
     <CodesignKey>iPhone Developer</CodesignKey>
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug</OutputPath>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Release</OutputPath>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />
@@ -172,7 +143,7 @@
   </Target>
   -->
   <ItemGroup>
-    <ProjectReference Include="..\..\..\MonoGame.Framework\MonoGame.Framework.iOS.csproj">
+    <ProjectReference Include="..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.iOS.csproj">
       <Project>{DB8508BB-9849-4CC2-BC0F-8EB5DACB3C47}</Project>
       <Name>MonoGame.Framework.iOS</Name>
     </ProjectReference>

+ 3 - 4
StarterKits/iOS/Marblets/Program.cs

@@ -22,13 +22,12 @@ namespace Marblets
 	[Register ("AppDelegate")]
 	class Program : UIApplicationDelegate 
 	{
+		private MarbletsGame game;
 		public override void FinishedLaunching (UIApplication app)
 		{
 			// Fun begins..
-			using (MarbletsGame game = new MarbletsGame())
-            {
-                game.Run();
-            }
+			game = new MarbletsGame();
+            game.Run();
 			
 			//MediaLibrary lib = new MediaLibrary();
 			//object result = lib.Playlists;

BIN
StarterKits/iOS/MemoryMadness/.DS_Store


BIN
StarterKits/iOS/MemoryMadness/Content/Fonts/GameplayLargeFont.xnb


BIN
StarterKits/iOS/MemoryMadness/Content/Fonts/GameplaySmallFont.xnb


BIN
StarterKits/iOS/MemoryMadness/Content/Fonts/HighScoresFont.xnb


BIN
StarterKits/iOS/MemoryMadness/Content/Fonts/MenuFont.xnb


+ 0 - 105
StarterKits/iOS/MemoryMadness/Content/GamePlay/LevelDefinitions.xml

@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<Levels>
-  <Level Number="1">
-    <Pattern Id="1">Red</Pattern>
-  </Level>
-  <Level Number="2">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-  </Level>
-  <Level Number="3">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-  </Level>
-  <Level Number="4">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-  </Level>
-  <Level Number="5">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-    <Pattern Id="5">Green</Pattern>
-  </Level>
-  <Level Number="6">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-    <Pattern Id="5">Green</Pattern>
-    <Pattern Id="6">Yellow</Pattern>
-  </Level>
-  <Level Number="7">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-    <Pattern Id="5">Green</Pattern>
-    <Pattern Id="6">Yellow</Pattern>
-    <Pattern Id="7">Red</Pattern>
-  </Level>
-  <Level Number="8">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-    <Pattern Id="5">Green</Pattern>
-    <Pattern Id="6">Yellow</Pattern>
-    <Pattern Id="7">Red</Pattern>
-    <Pattern Id="8">Blue</Pattern>
-  </Level>
-  <Level Number="9">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-    <Pattern Id="5">Green</Pattern>
-    <Pattern Id="6">Yellow</Pattern>
-    <Pattern Id="7">Red</Pattern>
-    <Pattern Id="8">Blue</Pattern>
-    <Pattern Id="9">Yellow</Pattern>
-  </Level>
-  <Level Number="10">
-    <Pattern Id="1">Red</Pattern>
-    <Pattern Id="2">Green</Pattern>
-    <Pattern Id="3">Yellow</Pattern>
-    <Pattern Id="4">Blue</Pattern>
-    <Pattern Id="5">Green</Pattern>
-    <Pattern Id="6">Yellow</Pattern>
-    <Pattern Id="7">Red</Pattern>
-    <Pattern Id="8">Blue</Pattern>
-    <Pattern Id="9">Yellow</Pattern>
-    <Pattern Id="10">Green</Pattern>
-  </Level>
-
-  <!--<Level Number="1">
-        <Pattern Id="1">Red</Pattern>
-    </Level>
-    <Level Number="2">
-        <Pattern Id="1">Red</Pattern>
-        <Pattern Id="2">Red,Yellow</Pattern>
-    </Level>
-    <Level Number="3">
-        <Pattern Id="1">Red</Pattern>
-        <Pattern Id="2">Red,Yellow</Pattern>
-        <Pattern Id="3">Yellow,Green,Blue</Pattern>
-    </Level>
-    <Level Number="4">
-        <Pattern Id="1">Red</Pattern>
-        <Pattern Id="2">Red,Yellow</Pattern>
-        <Pattern Id="3">Yellow,Green,Blue</Pattern>
-        <Pattern Id="4">Green,Yellow</Pattern>
-    </Level>
-    <Level Number="5">
-        <Pattern Id="1">Red</Pattern>
-        <Pattern Id="2">Red,Yellow</Pattern>
-        <Pattern Id="3">Yellow,Green,Blue</Pattern>
-        <Pattern Id="4">Green,Yellow</Pattern>
-        <Pattern Id="5">Red,Green,Blue,Yellow</Pattern>
-    </Level>-->
-    
-</Levels>

BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/BlueButton.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/DefeatBuzzer.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/GreenButton.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/HighScoreScreen.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/LevelComplete.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/RedButton.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Sounds/YellowButton.wav


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/Instructions.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/Resuming.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/blank.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/gameplayBG.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/leftDoor.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/rightDoor.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/Backgrounds/titleBG.png


BIN
StarterKits/iOS/MemoryMadness/Content/Textures/ButtonStates.png


BIN
StarterKits/iOS/MemoryMadness/Default.png


+ 0 - 8
StarterKits/iOS/MemoryMadness/Info.plist

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>MinimumOSVersion</key>
-	<string>3.1</string>
-</dict>
-</plist>

+ 0 - 220
StarterKits/iOS/MemoryMadness/MemoryMadness.csproj

@@ -1,220 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{296EBAC0-9658-474D-9A9E-5A8F52BA316F}</ProjectGuid>
-    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>MemoryMadness</RootNamespace>
-    <AssemblyName>MemoryMadness</AssemblyName>
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-    <MtouchLink>None</MtouchLink>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <ConsolePause>false</ConsolePause>
-    <MtouchLink>None</MtouchLink>
-    <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>false</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhone\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <ConsolePause>false</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchArch>ARMv6</MtouchArch>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="monotouch" />
-    <Reference Include="System.Xml.Linq" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <Compile Include="Program.cs" />
-    <Compile Include="MemoryMadnessGame.cs" />
-    <Compile Include="Misc\AudioManager.cs" />
-    <Compile Include="Misc\Level.cs" />
-    <Compile Include="Misc\Settings.cs" />
-    <Compile Include="ScreenManager\GameScreen.cs" />
-    <Compile Include="ScreenManager\InputState.cs" />
-    <Compile Include="ScreenManager\MenuEntry.cs" />
-    <Compile Include="ScreenManager\MenuScreen.cs" />
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs" />
-    <Compile Include="ScreenManager\ScreenManager.cs" />
-    <Compile Include="Screens\BackgroundScreen.cs" />
-    <Compile Include="Screens\GameplayScreen.cs" />
-    <Compile Include="Screens\HighScoreScreen.cs" />
-    <Compile Include="Screens\LoadingAndInstructionsScreen.cs" />
-    <Compile Include="Screens\MainMenuScreen.cs" />
-    <Compile Include="Screens\NewGameSubMenu.cs" />
-    <Compile Include="Screens\PauseScreen.cs" />
-    <Compile Include="PhoneApplicationService.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="monogameicon.png" />
-    <None Include="Info.plist" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Content\" />
-    <Folder Include="Content\Fonts\" />
-    <Folder Include="Content\GamePlay\" />
-    <Folder Include="Content\Sounds\" />
-    <Folder Include="Content\Textures\" />
-    <Folder Include="Content\Textures\Backgrounds\" />
-    <Folder Include="Misc\" />
-    <Folder Include="ScreenManager\" />
-    <Folder Include="Screens\" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Content\Sounds\BlueButton.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\DefeatBuzzer.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\GreenButton.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\HighScoreScreen.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\LevelComplete.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\RedButton.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\YellowButton.wav">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\ButtonStates.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\blank.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\gameplayBG.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\Instructions.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\leftDoor.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\Resuming.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\rightDoor.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\titleBG.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\GamePlay\LevelDefinitions.xml">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Default.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Fonts\MenuFont.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Fonts\HighScoresFont.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Fonts\GameplaySmallFont.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Fonts\GameplayLargeFont.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\MonoGame.Framework\MonoGame.Framework.iOS.csproj">
-      <Project>{DB8508BB-9849-4CC2-BC0F-8EB5DACB3C47}</Project>
-      <Name>MonoGame.Framework.iOS</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 0 - 276
StarterKits/iOS/MemoryMadness/MemoryMadnessGame.cs

@@ -1,276 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// MemoryMadness.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.GamerServices;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Media;
-using GameStateManagement;
-using System.IO.IsolatedStorage;
-using System.IO;
-
-#endregion
-
-namespace MemoryMadness
-{
-    /// <summary>
-    /// This is the main type for your game
-    /// </summary>
-    public class MemoryMadnessGame : Microsoft.Xna.Framework.Game
-    {
-        #region Fields
-
-        GraphicsDeviceManager graphics;
-        ScreenManager screenManager;
-
-        #endregion
-
-        #region Initializations
-
-        public MemoryMadnessGame()
-        {
-            graphics = new GraphicsDeviceManager(this);
-            Content.RootDirectory = "Content";
-
-            // Frame rate is 30 fps by default for Windows Phone.
-            TargetElapsedTime = TimeSpan.FromTicks(333333);
-
-            //Create a new instance of the Screen Manager
-            screenManager = new ScreenManager(this);
-            Components.Add(screenManager);
-
-            // Switch to full screen for best game experience
-            graphics.IsFullScreen = true;
-
-            graphics.PreferredBackBufferHeight = 800;
-            graphics.PreferredBackBufferWidth = 480;
-
-            graphics.SupportedOrientations = DisplayOrientation.Portrait;
-
-            // Initialize sound system
-            AudioManager.Initialize(this);
-
-            // Add two new screens
-            screenManager.AddScreen(new BackgroundScreen(false), null);
-			screenManager.AddScreen(new MainMenuScreen(), null);
-/*            if (PhoneApplicationService.Current.StartupMode == StartupMode.Launch)
-                screenManager.AddScreen(new MainMenuScreen(), null);
-            else
-                screenManager.AddScreen(new PauseScreen(true), null);
-
-            // Subscribe to the application's lifecycle events
-            PhoneApplicationService.Current.Activated += GameActivated;
-            PhoneApplicationService.Current.Deactivated += GameDeactivated;
-            PhoneApplicationService.Current.Closing += GameClosing;
-            PhoneApplicationService.Current.Launching += GameLaunching;*/
-        }
-
-        #endregion
-
-        #region Loading
-
-        /// <summary>
-        /// LoadContent will be called once per game and is the place to load
-        /// all of your content.
-        /// </summary>
-        protected override void LoadContent()
-        {
-            AudioManager.LoadSounds();
-            HighScoreScreen.LoadHighscores();
-            base.LoadContent();
-
-        }
-
-        #endregion
-
-        #region Tombstoning
-
-        /// <summary>
-        /// Saves the full state to the state object and the persistent state to 
-        /// isolated storage.
-        /// </summary>
- /*       void GameDeactivated(object sender, DeactivatedEventArgs e)
-        {
-            SaveToStateObject();
-
-            if (PhoneApplicationService.Current.State.ContainsKey("CurrentLevel"))
-            {
-                SaveToIsolatedStorage((int)PhoneApplicationService.Current.State["CurrentLevel"]);
-                PhoneApplicationService.Current.State.Remove("CurrentLevel");
-            }
-        }
-
-        /// <summary>
-        /// Loads the full state from the state object.
-        /// </summary>
-        void GameActivated(object sender, ActivatedEventArgs e)
-        {
-            LoadFromStateObject();
-            LoadFromIsolatedStorage();
-        }
-
-        /// <summary>
-        /// Saves persistent state to isolated storage.
-        /// </summary>
-        void GameClosing(object sender, ClosingEventArgs e)
-        {
-            if (PhoneApplicationService.Current.State.ContainsKey("CurrentLevel"))
-            {
-                SaveToIsolatedStorage((int)PhoneApplicationService.Current.State["CurrentLevel"]);
-                PhoneApplicationService.Current.State.Remove("CurrentLevel");
-            }
-            else
-            {
-                CleanIsolatedStorage();
-            }
-        }*/
-
-
-        /// <summary>
-        /// Loads persistent state from isolated storage.
-        /// </summary>
-/*        void GameLaunching(object sender, LaunchingEventArgs e)
-        {
-            LoadFromIsolatedStorage();
-        }*/
-
-        #region Helpers functionality
-        /// <summary>
-        /// Saves current gameplay progress to the state object.
-        /// </summary>
-        private void SaveToStateObject()
-        {
-            // Get the gameplay screen object
-            GameplayScreen gameplayScreen = GetGameplayScreen();
-
-            if (null != gameplayScreen)
-            {
-                // If gameplay screen object found save current game progress to 
-                // the state object
-                PhoneApplicationService.Current.State["MovesPerformed"] =
-                    gameplayScreen.currentLevel.MovesPerformed;
-
-                PhoneApplicationService.Current.State["CurrentLevel"] =
-                    gameplayScreen.currentLevel.levelNumber;
-            }
-        }
-
-        /// <summary>
-        /// Loads the game progress from the state object if such information exits.
-        /// </summary>
-        private void LoadFromStateObject()
-        {
-            int sequenceProgress = 0;
-
-            // Check state object for sequence progress and load it if found
-            if (!PhoneApplicationService.Current.State.ContainsKey("MovesPerformed"))
-                PhoneApplicationService.Current.State["MovesPerformed"] = sequenceProgress;
-        }
-
-        /// <summary>
-        /// Saves the level progress to isolated storage
-        /// </summary>
-        /// <param name="currentLevel">The level number to save</param>
-        private void SaveToIsolatedStorage(int currentLevel)
-        {
-            // Get Isolated Storage for current application
-            using (IsolatedStorageFile isolatedStorageFile
-                = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // Create/overwrite file and save provided value
-                /*using (IsolatedStorageFileStream fileStream
-                    = isolatedStorageFile.CreateFile("MemoryMadness.dat"))
-                {
-                    using (StreamWriter streamWriter = new StreamWriter(fileStream))
-                    {
-                        streamWriter.WriteLine(currentLevel);
-                    }
-                }*/
-
-            }
-        }
-
-        /// <summary>
-        /// Clean isolated storage from previously saved information.
-        /// </summary>
-        private void CleanIsolatedStorage()
-        {
-            using (IsolatedStorageFile isolatedStorageFile
-                = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                isolatedStorageFile.DeleteFile("MemoryMadness.dat");
-            }
-
-        }
-
-        /// <summary>
-        /// Loads game progress from isolated storage file if such a file exits.
-        /// </summary>
-        private void LoadFromIsolatedStorage()
-        {
-            int currentLevel = 1;
-
-            // Get the isolated storage for the current application
-            using (IsolatedStorageFile isolatedStorageFile
-                = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // Check whether or not the data file exists
-                /*if (isolatedStorageFile.FileExists("MemoryMadness.dat"))
-                {
-                    // If the file exits, open it and read its information
-                    using (IsolatedStorageFileStream fileStream
-                        = isolatedStorageFile.OpenFile("MemoryMadness.dat", FileMode.Open))
-                    {
-                        using (StreamReader streamReader = new StreamReader(fileStream))
-                        {
-                            if (!int.TryParse(streamReader.ReadLine(), out currentLevel))
-                                currentLevel = 1;
-                        }
-                    }
-                }*/
-            }
-
-            PhoneApplicationService.Current.State["CurrentLevel"] = currentLevel;
-        }
-
-        /// <summary>
-        /// Finds a gameplay screen objects among all screens and returns it.
-        /// </summary>
-        /// <returns>A gameplay screen instance, or null if none 
-        /// are available.</returns>
-        private GameplayScreen GetGameplayScreen()
-        {
-            var screens = screenManager.GetScreens();
-
-            foreach (var screen in screens)
-            {
-                if (screen is GameplayScreen)
-                {
-                    return screen as GameplayScreen;
-                }
-            }
-
-            return null;            
-        }
-
-        #endregion
-
-        #endregion
-    }
-}

+ 0 - 275
StarterKits/iOS/MemoryMadness/Misc/AudioManager.cs

@@ -1,275 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// AudioManager.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-
-#endregion
-
-namespace MemoryMadness
-{
-    /// <summary>
-    /// Component that manages audio playback for all sounds.
-    /// </summary>
-    public class AudioManager : GameComponent
-    {
-        #region Fields
-
-        #region Singleton
-
-        /// <summary>
-        /// The singleton for this type.
-        /// </summary>
-        static AudioManager audioManager = null;
-        public static AudioManager Instance
-        {
-            get { return audioManager; }
-        }
-
-        public static bool IsInitialized
-        {
-            get { return audioManager.isInitialized; }
-        }
-
-        #endregion
-
-        #region Audio Data
-
-        SoundEffectInstance musicSound;
-        Dictionary<string, SoundEffectInstance> soundBank;
-        string[,] soundNames;
-
-        #endregion
-
-        bool isInitialized;
-
-        #endregion
-
-        #region Initialization
-
-        private AudioManager(Game game)
-            : base(game) { }
-
-        /// <summary>
-        /// Initialize the static AudioManager functionality.
-        /// </summary>
-        /// <param name="game">The game that this component will be attached to.</param>
-        public static void Initialize(Game game)
-        {
-            audioManager = new AudioManager(game);
-
-            game.Components.Add(audioManager);
-        }
-
-        #endregion
-
-        #region Loading Methodes
-
-        /// <summary>
-        /// Loads a sounds and organizes them for future usage
-        /// </summary>
-        public static void LoadSounds()
-        {
-            string soundLocation = "Sounds/";
-
-            audioManager.soundNames = new string[,] 
-            { 
-                {"RedButton", "red"},
-                {"GreenButton", "green"},
-                {"BlueButton", "blue"},
-                {"YellowButton", "yellow"},
-                {"HighScoreScreen", "doorOpen"},
-                {"LevelComplete", "success"},
-                {"DefeatBuzzer", "fail"}
-            };
-
-            audioManager.soundBank = new Dictionary<string, SoundEffectInstance>();
-
-            for (int i = 0; i < audioManager.soundNames.GetLength(0); i++)
-            {
-                SoundEffect se = audioManager.Game.Content.Load<SoundEffect>(
-                    soundLocation + audioManager.soundNames[i, 0]);
-                audioManager.soundBank.Add(
-                    audioManager.soundNames[i, 1], se.CreateInstance());
-            }
-
-            audioManager.isInitialized = true;
-        }
-
-        #endregion
-
-        #region Sound Methods
-
-        /// <summary>
-        /// Indexer. Return a sound instance by name
-        /// </summary>
-        public SoundEffectInstance this[string soundName]
-        {
-            get
-            {
-                if (audioManager.soundBank.ContainsKey(soundName))
-                    return audioManager.soundBank[soundName];
-                else
-                    return null;
-            }
-        }
-
-        /// <summary>
-        /// Plays a sound by name.
-        /// </summary>
-        /// <param name="soundName">The name of the sound to play</param>
-        public static void PlaySound(string soundName)
-        {
-            // If the sound exists, start it
-            if (audioManager.soundBank.ContainsKey(soundName))
-                audioManager.soundBank[soundName].Play();
-        }
-
-        /// <summary>
-        /// Plays a sound by name.
-        /// </summary>
-        /// <param name="soundName">The name of the sound to play</param>
-        /// <param name="isLooped">Indicates if the sound should loop</param>
-        public static void PlaySound(string soundName, bool isLooped)
-        {
-            // If the sound exists, start it
-            if (audioManager.soundBank.ContainsKey(soundName))
-            {
-                if (audioManager.soundBank[soundName].IsLooped != isLooped)
-                    audioManager.soundBank[soundName].IsLooped = isLooped;
-
-                audioManager.soundBank[soundName].Play();
-            }
-        }
-
-
-        /// <summary>
-        /// Stops a sound mid-play. If the sound is not playing, this
-        /// method does nothing.
-        /// </summary>
-        /// <param name="soundName">The name of the sound to stop</param>
-        public static void StopSound(string soundName)
-        {
-            // If the sound exists, stop it
-            if (audioManager.soundBank.ContainsKey(soundName))
-                audioManager.soundBank[soundName].Stop();
-        }
-
-        /// <summary>
-        /// Stops all currently playing sounds.
-        /// </summary>
-        public static void StopSounds()
-        {
-            foreach (var sound in audioManager.soundBank.Values)
-            {
-                if (sound.State != SoundState.Stopped)
-                {
-                    sound.Stop();
-                }
-            }            
-        }
-
-        /// <summary>
-        /// Checks whether or not sounds are currently playing.
-        /// </summary>
-        /// <returns>True if some sounds are playing, false otherwise.</returns>
-        public static bool AreSoundsPlaying()
-        {
-            foreach (var sound in audioManager.soundBank.Values)
-            {
-                if (sound.State == SoundState.Playing)
-                {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        /// <summary>
-        /// Pause or resume all sounds.
-        /// </summary>
-        /// <param name="resumeSounds">True to resume all paused sounds or false
-        /// to pause all playing sounds.</param>
-        public static void PauseResumeSounds(bool resumeSounds)
-        {
-            SoundState state = resumeSounds ? SoundState.Paused : SoundState.Playing;
-
-            foreach (var sound in audioManager.soundBank.Values)
-            {
-                if (sound.State == state)
-                {
-                    if (resumeSounds)
-                    {
-                        sound.Resume();
-                    }
-                    else
-                    {
-                        sound.Pause();
-                    }
-                }
-            }            
-        }
-        /// <summary>
-        /// Play music by sound name.
-        /// </summary>
-        /// <param name="musicSoundName">The name of the music sound.</param>
-        public static void PlayMusic(string musicSoundName)
-        {
-            // Stop the old music sound
-            if (audioManager.musicSound != null)
-                audioManager.musicSound.Stop(true);
-
-            // If the music sound exists
-            if (audioManager.soundBank.ContainsKey(musicSoundName))
-            {
-                // Get the instance and start it
-                audioManager.musicSound = audioManager.soundBank[musicSoundName];
-                if (!audioManager.musicSound.IsLooped)
-                    audioManager.musicSound.IsLooped = true;
-                audioManager.musicSound.Play();
-            }
-        }
-
-        #endregion
-
-        #region Instance Disposal Methods
-
-        /// <summary>
-        /// Clean up the component when it is disposing.
-        /// </summary>
-        protected override void Dispose(bool disposing)
-        {
-            try
-            {
-                if (disposing)
-                {
-                    foreach (var item in soundBank)
-                    {
-                        item.Value.Dispose();
-                    }
-                    soundBank.Clear();
-                    soundBank = null;
-                }
-            }
-            finally
-            {
-                base.Dispose(disposing);
-            }
-        }
-
-        #endregion
-    }
-}

+ 0 - 600
StarterKits/iOS/MemoryMadness/Misc/Level.cs

@@ -1,600 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// Level.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Graphics;
-using System.Xml.Linq;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class Level : DrawableGameComponent
-    {
-        #region Fields/Properties
-
-        public int levelNumber;
-        LinkedList<ButtonColors[]> sequence;
-        LinkedListNode<ButtonColors[]> currentSequenceItem;
-
-        public LevelState CurrentState;
-        public bool IsActive;
-
-        /// <summary>
-        /// The amount of moves correctly performed by the user so far
-        /// </summary>
-        public int MovesPerformed { get; set; }
-
-        // Sequence demonstration delays are multiplied by this each level
-        const float DifficultyFactor = 0.75f;
-
-        // Define the delay between flashes when the current set of moves is 
-        // demonstrated to the player
-        TimeSpan delayFlashOn = TimeSpan.FromSeconds(1);
-        TimeSpan delayFlashOff = TimeSpan.FromSeconds(0.5);
-
-        // Define the allowed delay between two user inputs
-        TimeSpan delayBetweenInputs = TimeSpan.FromSeconds(5);
-
-        // Define the delay per move which will be used to calculate the overall time
-        // the player has to input the sample. For example, if this delay is 4 and the
-        // current level has 5 steps, the user will have 20 seconds overall to complete
-        // the level.
-        readonly TimeSpan DelayOverallPerInput = TimeSpan.FromSeconds(4);
-
-        // The display period for the user's own input (feedback)
-        readonly TimeSpan InputFlashDuration = TimeSpan.FromSeconds(0.75);
-
-        TimeSpan delayPeriod;
-        TimeSpan inputFlashPeriod;
-        TimeSpan elapsedPatternInput;
-        TimeSpan overallAllowedInputPeriod;
-
-        bool flashOn;
-
-        bool drawUserInput;
-
-        ButtonColors?[] currentTouchSampleColors = new ButtonColors?[4];
-
-        // Define spheres covering the various buttons
-        BoundingSphere redShpere;
-        BoundingSphere blueShpere;
-        BoundingSphere greenShpere;
-        BoundingSphere yellowShpere;
-
-        // Rendering members
-        SpriteBatch spriteBatch;
-        Texture2D buttonsTexture;
-
-        #endregion
-
-        #region Initializaton
-
-        public Level(Game game, SpriteBatch spriteBatch, int levelNumber,
-            int movesPerformed, Texture2D buttonsTexture)
-            : base(game)
-        {
-            this.levelNumber = levelNumber;
-            this.spriteBatch = spriteBatch;
-            CurrentState = LevelState.NotReady;
-            this.buttonsTexture = buttonsTexture;
-            MovesPerformed = movesPerformed;
-        }
-
-        public Level(Game game, SpriteBatch spriteBatch, int levelNumber,
-            Texture2D buttonsTexture)
-            : this(game, spriteBatch, levelNumber, 0, buttonsTexture)
-        {
-            
-        }
-
-        public override void Initialize()
-        {
-            //Update delays to match level difficulty
-            UpdateDelays();
-
-            // Define button bounding spheres
-            DefineBoundingSpheres();
-
-            // Load sequences for current level from definitions XML
-            LoadLevelSequences();
-        }
-
-        #endregion        
-
-        #region Update and Render
-
-        public override void Update(GameTime gameTime)
-        {
-            if (!IsActive)
-            {
-                base.Update(gameTime);
-                return;
-            }
-
-            switch (CurrentState)
-            {
-                case LevelState.NotReady:
-                    // Nothing to update in this state
-                    break;
-                case LevelState.Ready:
-                    // Wait for a while before demonstrating the level's move set
-                    delayPeriod += gameTime.ElapsedGameTime;
-                    if (delayPeriod >= delayFlashOn)
-                    {
-                        // Initiate flashing sequence
-                        currentSequenceItem = sequence.First;
-                        PlaySequenceStepSound();
-                        CurrentState = LevelState.Flashing;
-                        delayPeriod = TimeSpan.Zero;
-                        flashOn = true;
-                    }
-                    break;
-                case LevelState.Flashing:
-                    // Display the level's move set. When done, start accepting
-                    // user input
-                    delayPeriod += gameTime.ElapsedGameTime;
-                    if ((delayPeriod >= delayFlashOn) && (flashOn))
-                    {
-                        delayPeriod = TimeSpan.Zero;
-                        flashOn = false;
-                    }
-                    if ((delayPeriod >= delayFlashOff) && (!flashOn))
-                    {
-                        delayPeriod = TimeSpan.Zero;
-                        currentSequenceItem = currentSequenceItem.Next;
-                        PlaySequenceStepSound();
-                        flashOn = true;
-                    }
-                    if (currentSequenceItem == null)
-                    {
-                        InitializeUserInputStage();
-                    }
-                    break;
-                case LevelState.Started:
-                case LevelState.InProcess:
-                    delayPeriod += gameTime.ElapsedGameTime;
-                    inputFlashPeriod += gameTime.ElapsedGameTime;
-                    elapsedPatternInput += gameTime.ElapsedGameTime;
-                    if ((delayPeriod >= delayBetweenInputs) ||
-                        (elapsedPatternInput >= overallAllowedInputPeriod))
-                    {
-                        // The user was not quick enough
-                        inputFlashPeriod = TimeSpan.Zero;
-                        CurrentState = LevelState.FinishedFail;
-                    }
-                    if (inputFlashPeriod >= InputFlashDuration)
-                    {
-                        drawUserInput = false;
-                    }
-                    break;
-                case LevelState.Fault:
-                    inputFlashPeriod += gameTime.ElapsedGameTime;
-                    if (inputFlashPeriod >= InputFlashDuration)
-                    {
-                        drawUserInput = false;
-                        CurrentState = LevelState.FinishedFail;
-                    }
-                    break;
-                case LevelState.Success:
-                    inputFlashPeriod += gameTime.ElapsedGameTime;
-                    if (inputFlashPeriod >= InputFlashDuration)
-                    {
-                        drawUserInput = false;
-                        CurrentState = LevelState.FinishedOk;
-                    }
-                    break;
-                case LevelState.FinishedOk:
-                    // Gameplay screen will advance the level
-                    break;
-                case LevelState.FinishedFail:
-                    // Gameplay screen will reset the level
-                    break;
-                default:
-                    break;
-            }
-
-            base.Update(gameTime);
-        }
-
-        public override void Draw(GameTime gameTime)
-        {
-            if (IsActive)
-            {
-                spriteBatch.Begin();
-
-                Rectangle redButtonRectangle = Settings.RedButtonDim;
-                Rectangle greenButtonRectangle = Settings.GreenButtonDim;
-                Rectangle blueButtonRectangle = Settings.BlueButtonDim;
-                Rectangle yellowButtonRectangle = Settings.YellowButtonDim;
-
-                // Draw the darkened buttons
-                DrawDarkenedButtons(redButtonRectangle, greenButtonRectangle, 
-                    blueButtonRectangle, yellowButtonRectangle);
-
-                switch (CurrentState)
-                {
-                    case LevelState.NotReady:
-                    case LevelState.Ready:
-                        // Nothing extra to draw
-                        break;
-                    case LevelState.Flashing:
-                        if ((currentSequenceItem != null) && (flashOn))
-                        {
-                            ButtonColors[] toDraw = currentSequenceItem.Value;
-                            DrawLitButtons(toDraw);
-                        }
-                        break;
-                    case LevelState.Started:
-                    case LevelState.InProcess:
-                    case LevelState.Fault:
-                    case LevelState.Success:
-                        if (drawUserInput)
-                        {
-                            List<ButtonColors> toDraw =
-                                new List<ButtonColors>(currentTouchSampleColors.Length);
-
-                            foreach (var touchColor in currentTouchSampleColors)
-                            {
-                                if (touchColor.HasValue)
-                                {
-                                    toDraw.Add(touchColor.Value);
-                                }
-                            }
-                            
-                            DrawLitButtons(toDraw.ToArray());
-                        }
-                        break;
-                    case LevelState.FinishedOk:
-                        break;
-                    case LevelState.FinishedFail:
-                        break;
-                    default:
-                        break;
-                }
-
-                spriteBatch.End();
-            }
-            base.Draw(gameTime);
-        }
-
-        #endregion
-
-        #region Public functionality
-
-        /// <summary>
-        /// Handle user presses.
-        /// </summary>
-        /// <param name="touchPoints">The locations touched by the user. The list
-        /// is expected to contain at least one member.</param>
-        public void RegisterTouch(List<TouchLocation> touchPoints)
-        {
-            if ((CurrentState == LevelState.Started ||
-                CurrentState == LevelState.InProcess))
-            {
-                ButtonColors[] stepColors = sequence.First.Value;
-                
-                bool validTouchRegistered = false;
-
-                if (touchPoints.Count > 0)
-                {
-                    // Reset current touch sample
-                    for (int i = 0; i < Settings.ButtonAmount; i++)
-                    {
-                        currentTouchSampleColors[i] = null;
-                    }
-
-                    // Go over the touch points and populate the current touch sample
-                    for (int i = 0; i < touchPoints.Count; i++)
-                    {
-                        var gestureBox = new BoundingBox(
-                            new Vector3(touchPoints[i].Position.X - 5,
-                                touchPoints[i].Position.Y - 5, 0),
-                            new Vector3(touchPoints[i].Position.X + 10,
-                                touchPoints[i].Position.Y + 10, 0));
-
-                        if (redShpere.Intersects(gestureBox))
-                        {
-                            currentTouchSampleColors[i] = ButtonColors.Red;
-                            AudioManager.PlaySound("red");
-                        }
-                        else if (yellowShpere.Intersects(gestureBox))
-                        {
-                            currentTouchSampleColors[i] = ButtonColors.Yellow;
-                            AudioManager.PlaySound("yellow");
-                        }
-                        else if (blueShpere.Intersects(gestureBox))
-                        {
-                            currentTouchSampleColors[i] = ButtonColors.Blue;
-                            AudioManager.PlaySound("blue");
-                        }
-                        else if (greenShpere.Intersects(gestureBox))
-                        {
-                            currentTouchSampleColors[i] = ButtonColors.Green;
-                            AudioManager.PlaySound("green");
-                        }
-
-                        CurrentState = LevelState.InProcess;
-                    }
-
-                    List<ButtonColors> colorsHit =
-                        new List<ButtonColors>(currentTouchSampleColors.Length);
-
-                    // Check if the user pressed at least one of the colored buttons
-                    foreach (var hitColor in currentTouchSampleColors)
-                    {
-                        if (hitColor.HasValue)
-                        {
-                            validTouchRegistered = true;
-                            colorsHit.Add(hitColor.Value);
-                        }
-                    }                    
-                    
-                    // Find the buttons which the user failed to touch
-                    List<ButtonColors> missedColors =
-                        new List<ButtonColors>(stepColors.Length);
-
-                    foreach (var stepColor in stepColors)
-                    {
-                        if (!colorsHit.Contains(stepColor))
-                        {
-                            missedColors.Add(stepColor);
-                        }
-                    }
-
-                    // If the user failed to perform the current move, fail the level
-                    // Do nothing if no buttons were touched
-                    if (((missedColors.Count > 0) || 
-                        (touchPoints.Count != stepColors.Length)) && validTouchRegistered)
-                        CurrentState = LevelState.Fault;
-
-                    if (validTouchRegistered)
-                    {
-                        // Show user pressed buttons, reset timeout period 
-                        // for button flash
-                        drawUserInput = true;
-                        inputFlashPeriod = TimeSpan.Zero;
-
-                        MovesPerformed++;
-                        sequence.Remove(stepColors);
-
-                        if ((sequence.Count == 0) && (CurrentState != LevelState.Fault))
-                        {
-                            CurrentState = LevelState.Success;
-                        }
-                    }
-                }
-            }
-        }
-
-        #endregion
-
-        #region Private Functionality
-
-        /// <summary>
-        /// Load sequences for the current level from definitions XML
-        /// </summary>
-        private void LoadLevelSequences()
-        {
-            XDocument doc = XDocument.Load(@"Content\Gameplay\LevelDefinitions.xml");
-            var definitions = doc.Document.Descendants(XName.Get("Level"));
-
-            XElement levelDefinition = null;
-
-            foreach (var definition in definitions)
-            {
-                if (int.Parse(
-                    definition.Attribute(XName.Get("Number")).Value) == levelNumber)
-                {
-                    levelDefinition = definition;
-                    break;
-                }
-            }            
-
-            int skipMoves = 0; // Used to skip moves if we are resuming a level mid-play
-
-            // If definitions are found, create sequences
-            if (null != levelDefinition)
-            {
-                sequence = new LinkedList<ButtonColors[]>();
-
-                foreach (var pattern in
-                    levelDefinition.Descendants(XName.Get("Pattern")))
-                {
-                    if (skipMoves < MovesPerformed)
-                    {
-                        skipMoves++;
-                        continue;
-                    }
-
-                    string[] values = pattern.Value.Split(',');
-                    ButtonColors[] colors = new ButtonColors[values.Length];
-
-                    // Add each color to a sequence
-                    for (int i = 0; i < values.Length; i++)
-                    {
-                        colors[i] = (ButtonColors)Enum.Parse(
-                            typeof(ButtonColors), values[i], true);
-                    }
-
-                    // Add each sequence to the sequence list
-                    sequence.AddLast(colors);
-                }
-
-                if (MovesPerformed == 0)
-                {
-                    CurrentState = LevelState.Ready;
-                    delayPeriod = TimeSpan.Zero;
-                }
-                else
-                {
-                    InitializeUserInputStage();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Define button bounding spheres
-        /// </summary>
-        private void DefineBoundingSpheres()
-        {
-            redShpere = new BoundingSphere(
-                new Vector3(
-                    Settings.RedButtonPosition.X + Settings.ButtonSize.X / 2,
-                    Settings.RedButtonPosition.Y + Settings.ButtonSize.Y / 2, 0),
-                Settings.ButtonSize.X / 2);
-            blueShpere = new BoundingSphere(
-                new Vector3(
-                    Settings.BlueButtonPosition.X + Settings.ButtonSize.X / 2,
-                    Settings.BlueButtonPosition.Y + Settings.ButtonSize.Y / 2, 0),
-                Settings.ButtonSize.X / 2);
-            greenShpere = new BoundingSphere(
-                new Vector3(
-                    Settings.GreenButtonPosition.X + Settings.ButtonSize.X / 2,
-                    Settings.GreenButtonPosition.Y + Settings.ButtonSize.Y / 2, 0),
-                Settings.ButtonSize.X / 2);
-            yellowShpere = new BoundingSphere(
-                new Vector3(
-                    Settings.YellowButtonPosition.X + Settings.ButtonSize.X / 2,
-                    Settings.YellowButtonPosition.Y + Settings.ButtonSize.Y / 2, 0),
-                Settings.ButtonSize.X / 2);
-        }
-
-        /// <summary>
-        /// Update delays to match level difficulty
-        /// </summary>
-        private void UpdateDelays()
-        {
-            delayFlashOn = TimeSpan.FromTicks(
-                (long)(delayFlashOn.Ticks *
-                Math.Pow(DifficultyFactor, levelNumber - 1)));
-
-            delayFlashOff = TimeSpan.FromTicks(
-                (long)(delayFlashOff.Ticks *
-                Math.Pow(DifficultyFactor, levelNumber - 1)));
-        }
-
-        /// <summary>
-        /// Sets various members to allow the user to supply input.
-        /// </summary>
-        private void InitializeUserInputStage()
-        {
-            elapsedPatternInput = TimeSpan.Zero;
-            overallAllowedInputPeriod = TimeSpan.Zero;
-            CurrentState = LevelState.Started;
-            drawUserInput = false;
-            // Calculate total allowed timeout period for the entire level
-            overallAllowedInputPeriod = TimeSpan.FromSeconds(
-                DelayOverallPerInput.TotalSeconds * sequence.Count);
-        }
-
-        /// <summary>
-        /// Draws the set of lit buttons according to the colors specified.
-        /// </summary>
-        /// <param name="toDraw">The array of colors representing the lit 
-        /// buttons.</param>
-        private void DrawLitButtons(ButtonColors[] toDraw)
-        {
-            Vector2 position = Vector2.Zero;
-            Rectangle rectangle = Rectangle.Empty;
-
-            for (int i = 0; i < toDraw.Length; i++)
-            {
-                switch (toDraw[i])
-                {
-                    case ButtonColors.Red:
-                        position = Settings.RedButtonPosition;
-                        rectangle = Settings.RedButtonLit;
-                        break;
-                    case ButtonColors.Yellow:
-                        position = Settings.YellowButtonPosition;
-                        rectangle = Settings.YellowButtonLit;
-                        break;
-                    case ButtonColors.Blue:
-                        position = Settings.BlueButtonPosition;
-                        rectangle = Settings.BlueButtonLit;
-                        break;
-                    case ButtonColors.Green:
-                        position = Settings.GreenButtonPosition;
-                        rectangle = Settings.GreenButtonLit;
-                        break;
-                }
-
-                spriteBatch.Draw(buttonsTexture, position, rectangle, Color.White);
-            }
-        }
-
-        /// <summary>
-        /// Draw the darkened buttons
-        /// </summary>
-        /// <param name="redButtonRectangle">Red button rectangle 
-        /// in source texture.</param>
-        /// <param name="greenButtonRectangle">Green button rectangle 
-        /// in source texture.</param>
-        /// <param name="blueButtonRectangle">Blue button rectangle
-        /// in source texture.</param>
-        /// <param name="yellowButtonRectangle">Yellow button rectangle
-        /// in source texture.</param>
-        private void DrawDarkenedButtons(Rectangle redButtonRectangle, 
-            Rectangle greenButtonRectangle, Rectangle blueButtonRectangle, 
-            Rectangle yellowButtonRectangle)
-        {
-            spriteBatch.Draw(buttonsTexture, Settings.RedButtonPosition,
-                redButtonRectangle, Color.White);
-            spriteBatch.Draw(buttonsTexture, Settings.GreenButtonPosition,
-                greenButtonRectangle, Color.White);
-            spriteBatch.Draw(buttonsTexture, Settings.BlueButtonPosition,
-                blueButtonRectangle, Color.White);
-            spriteBatch.Draw(buttonsTexture, Settings.YellowButtonPosition,
-                yellowButtonRectangle, Color.White);
-        }
-
-        /// <summary>
-        /// Plays a sound appropriate to the current color flashed by the computer
-        /// </summary>
-        private void PlaySequenceStepSound()
-        {
-            if (currentSequenceItem == null)
-            {
-                return;
-            }
-
-            for (int i = 0; i < currentSequenceItem.Value.Length; ++i)
-            {
-                switch (currentSequenceItem.Value[i])
-                {
-                    case ButtonColors.Red:
-                        AudioManager.PlaySound("red");
-                        break;
-                    case ButtonColors.Yellow:
-                        AudioManager.PlaySound("yellow");
-                        break;
-                    case ButtonColors.Blue:
-                        AudioManager.PlaySound("blue");
-                        break;
-                    case ButtonColors.Green:
-                        AudioManager.PlaySound("green");
-                        break;
-                    default:
-                        break;
-                }
-            }
-        }
-
-        #endregion
-    }
-}

+ 0 - 97
StarterKits/iOS/MemoryMadness/Misc/Settings.cs

@@ -1,97 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// Settings.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.Xna.Framework;
-
-#endregion
-
-namespace MemoryMadness
-{
-    enum ButtonColors
-    {
-        Red,
-        Yellow,
-        Blue,
-        Green
-    }
-
-    enum LevelState
-    {
-        NotReady,
-        Ready,
-        Flashing,
-        Started,
-        InProcess,
-        Fault,
-        Success,
-        FinishedOk,
-        FinishedFail
-    }
-
-    enum TouchInputState
-    {
-        Idle,
-        GracePeriod
-    }
-
-    static class Constants
-    {        
-        public const string HighscorePopupTitle = "You made a high score!";
-        public const string HighscorePopupText = "Enter your name (max 15 characters)";
-        public const string HighscorePopupDefault = "Player";
-    }
-
-    static class Settings
-    {
-        // Amount of buttons
-        public static int ButtonAmount = 4;
-
-        // Sliding doors animation constants
-        public static int DoorsAnimationStep = 5;
-        public static Vector2 LeftDoorClosedPosition = new Vector2(0, 233);
-        public static Vector2 LeftDoorOpenedPosition = new Vector2(-54, 233);
-        public static Vector2 RightDoorClosedPosition = new Vector2(230, 233);
-        public static Vector2 RightDoorOpenedPosition = new Vector2(284, 233);
-
-        // Color button locations
-        public static Vector2 RedButtonPosition = new Vector2(14,29);
-        public static Vector2 GreenButtonPosition = new Vector2(161, 29);
-        public static Vector2 BlueButtonPosition = new Vector2(14, 378);
-        public static Vector2 YellowButtonPosition = new Vector2(161, 378);
-
-        // Color button positions in the texture strip, with their sizes
-        public static Vector2 ButtonSize = new Vector2(111, 123);
-        public static Rectangle RedButtonDim = new Rectangle((int)ButtonSize.X * 0, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-        public static Rectangle RedButtonLit = new Rectangle((int)ButtonSize.X * 1, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-
-        public static Rectangle YellowButtonDim = new Rectangle((int)ButtonSize.X * 2, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-        public static Rectangle YellowButtonLit = new Rectangle((int)ButtonSize.X * 3, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-
-        public static Rectangle GreenButtonDim = new Rectangle((int)ButtonSize.X * 4, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-        public static Rectangle GreenButtonLit = new Rectangle((int)ButtonSize.X * 5, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-
-        public static Rectangle BlueButtonDim = new Rectangle((int)ButtonSize.X * 6, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-        public static Rectangle BlueButtonLit = new Rectangle((int)ButtonSize.X * 7, 0, 
-            (int)ButtonSize.X, (int)ButtonSize.Y);
-    }
-}

+ 0 - 34
StarterKits/iOS/MemoryMadness/PhoneApplicationService.cs

@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace MemoryMadness
-{
-	public class PhoneApplicationService
-	{
-		private static PhoneApplicationService _current = null;
-		private Dictionary<string,object> _state;
-		
-		private PhoneApplicationService ()
-		{
-			_state = new Dictionary<string, object>();
-		}
-		
-		public static PhoneApplicationService Current
-		{
-			get
-			{
-				if (_current == null)
-					_current = new PhoneApplicationService();
-				return _current;
-			}
-		}
-		
-		public Dictionary<string,object> State
-		{
-			get
-			{
-				return _state;
-			}
-		}
-	}
-}
-

+ 0 - 27
StarterKits/iOS/MemoryMadness/Program.cs

@@ -1,27 +0,0 @@
-#region Using Statements
-using System;
-using MonoTouch.Foundation;
-using MonoTouch.UIKit;
-using Microsoft.Xna;
-using Microsoft.Xna.Framework.Media;
-#endregion
-
-namespace MemoryMadness
-{
-    [Register ("AppDelegate")]
-	class Program : UIApplicationDelegate 
-	{
-		public override void FinishedLaunching (UIApplication app)
-		{
-			using (MemoryMadnessGame game = new MemoryMadnessGame())
-            {
-                game.Run();
-            }
-		}
-
-		static void Main (string [] args)
-		{
-			UIApplication.Main (args,null,"AppDelegate");
-		}
-	}
-}

+ 0 - 394
StarterKits/iOS/MemoryMadness/ScreenManager/GameScreen.cs

@@ -1,394 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// GameScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Input.Touch;
-using System.IO;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Enum describes the screen transition state.
-    /// </summary>
-    public enum ScreenState
-    {
-        TransitionOn,
-        Active,
-        TransitionOff,
-        Hidden,
-    }
-
-
-    /// <summary>
-    /// A screen is a single layer that has update and draw logic, and which
-    /// can be combined with other layers to build up a complex menu system.
-    /// For instance the main menu, the options menu, the "are you sure you
-    /// want to quit" message box, and the main game itself are all implemented
-    /// as screens.
-    /// </summary>
-    public abstract class GameScreen
-    {
-        #region Properties
-
-
-        /// <summary>
-        /// Normally when one screen is brought up over the top of another,
-        /// the first screen will transition off to make room for the new
-        /// one. This property indicates whether the screen is only a small
-        /// popup, in which case screens underneath it do not need to bother
-        /// transitioning off.
-        /// </summary>
-        public bool IsPopup
-        {
-            get { return isPopup; }
-            protected set { isPopup = value; }
-        }
-
-        bool isPopup = false;
-
-
-        /// <summary>
-        /// Indicates how long the screen takes to
-        /// transition on when it is activated.
-        /// </summary>
-        public TimeSpan TransitionOnTime
-        {
-            get { return transitionOnTime; }
-            protected set { transitionOnTime = value; }
-        }
-
-        TimeSpan transitionOnTime = TimeSpan.Zero;
-
-
-        /// <summary>
-        /// Indicates how long the screen takes to
-        /// transition off when it is deactivated.
-        /// </summary>
-        public TimeSpan TransitionOffTime
-        {
-            get { return transitionOffTime; }
-            protected set { transitionOffTime = value; }
-        }
-
-        TimeSpan transitionOffTime = TimeSpan.Zero;
-
-
-        /// <summary>
-        /// Gets the current position of the screen transition, ranging
-        /// from zero (fully active, no transition) to one (transitioned
-        /// fully off to nothing).
-        /// </summary>
-        public float TransitionPosition
-        {
-            get { return transitionPosition; }
-            protected set { transitionPosition = value; }
-        }
-
-        float transitionPosition = 1;
-
-
-        /// <summary>
-        /// Gets the current alpha of the screen transition, ranging
-        /// from 1 (fully active, no transition) to 0 (transitioned
-        /// fully off to nothing).
-        /// </summary>
-        public float TransitionAlpha
-        {
-            get { return 1f - TransitionPosition; }
-        }
-
-
-        /// <summary>
-        /// Gets the current screen transition state.
-        /// </summary>
-        public ScreenState ScreenState
-        {
-            get { return screenState; }
-            protected set { screenState = value; }
-        }
-
-        ScreenState screenState = ScreenState.TransitionOn;
-
-
-        /// <summary>
-        /// There are two possible reasons why a screen might be transitioning
-        /// off. It could be temporarily going away to make room for another
-        /// screen that is on top of it, or it could be going away for good.
-        /// This property indicates whether the screen is exiting for real:
-        /// if set, the screen will automatically remove itself as soon as the
-        /// transition finishes.
-        /// </summary>
-        public bool IsExiting
-        {
-            get { return isExiting; }
-            protected internal set { isExiting = value; }
-        }
-
-        bool isExiting = false;
-
-
-        /// <summary>
-        /// Checks whether this screen is active and can respond to user input.
-        /// </summary>
-        public bool IsActive
-        {
-            get
-            {
-                return !otherScreenHasFocus &&
-                       (screenState == ScreenState.TransitionOn ||
-                        screenState == ScreenState.Active);
-            }
-        }
-
-        bool otherScreenHasFocus;
-
-
-        /// <summary>
-        /// Gets the manager that this screen belongs to.
-        /// </summary>
-        public ScreenManager ScreenManager
-        {
-            get { return screenManager; }
-            internal set { screenManager = value; }
-        }
-
-        ScreenManager screenManager;
-
-
-        /// <summary>
-        /// Gets the index of the player who is currently controlling this screen,
-        /// or null if it is accepting input from any player. This is used to lock
-        /// the game to a specific player profile. The main menu responds to input
-        /// from any connected gamepad, but whichever player makes a selection from
-        /// this menu is given control over all subsequent screens, so other gamepads
-        /// are inactive until the controlling player returns to the main menu.
-        /// </summary>
-        public PlayerIndex? ControllingPlayer
-        {
-            get { return controllingPlayer; }
-            internal set { controllingPlayer = value; }
-        }
-
-        PlayerIndex? controllingPlayer;
-
-        /// <summary>
-        /// Gets the gestures the screen is interested in. Screens should be as specific
-        /// as possible with gestures to increase the accuracy of the gesture engine.
-        /// For example, most menus only need Tap or perhaps Tap and VerticalDrag to operate.
-        /// These gestures are handled by the ScreenManager when screens change and
-        /// all gestures are placed in the InputState passed to the HandleInput method.
-        /// </summary>
-        public GestureType EnabledGestures
-        {
-            get { return enabledGestures; }
-            protected set
-            {
-                enabledGestures = value;
-
-                // the screen manager handles this during screen changes, but
-                // if this screen is active and the gesture types are changing,
-                // we have to update the TouchPanel ourself.
-                if (ScreenState == ScreenState.Active)
-                {
-                    TouchPanel.EnabledGestures = value;
-                }
-            }
-        }
-
-        GestureType enabledGestures = GestureType.None;
-
-        /// <summary>
-        /// Gets whether or not this screen is serializable. If this is true,
-        /// the screen will be recorded into the screen manager's state and
-        /// its Serialize and Deserialize methods will be called as appropriate.
-        /// If this is false, the screen will be ignored during serialization.
-        /// By default, all screens are assumed to be serializable.
-        /// </summary>
-        public bool IsSerializable
-        {
-            get { return isSerializable; }
-            protected set { isSerializable = value; }
-        }
-
-        bool isSerializable = true;
-
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Load graphics content for the screen.
-        /// </summary>
-        public virtual void LoadContent() { }
-
-
-        /// <summary>
-        /// Unload content for the screen.
-        /// </summary>
-        public virtual void UnloadContent() { }
-
-
-        #endregion
-
-        #region Update and Draw
-
-
-        /// <summary>
-        /// Allows the screen to run logic, such as updating the transition position.
-        /// Unlike HandleInput, this method is called regardless of whether the screen
-        /// is active, hidden, or in the middle of a transition.
-        /// </summary>
-        public virtual void Update(GameTime gameTime, bool otherScreenHasFocus,
-                                                      bool coveredByOtherScreen)
-        {
-            this.otherScreenHasFocus = otherScreenHasFocus;
-
-            if (isExiting)
-            {
-                // If the screen is going away to die, it should transition off.
-                screenState = ScreenState.TransitionOff;
-
-                if (!UpdateTransition(gameTime, transitionOffTime, 1))
-                {
-                    // When the transition finishes, remove the screen.
-                    ScreenManager.RemoveScreen(this);
-                }
-            }
-            else if (coveredByOtherScreen)
-            {
-                // If the screen is covered by another, it should transition off.
-                if (UpdateTransition(gameTime, transitionOffTime, 1))
-                {
-                    // Still busy transitioning.
-                    screenState = ScreenState.TransitionOff;
-                }
-                else
-                {
-                    // Transition finished!
-                    screenState = ScreenState.Hidden;
-                }
-            }
-            else
-            {
-                // Otherwise the screen should transition on and become active.
-                if (UpdateTransition(gameTime, transitionOnTime, -1))
-                {
-                    // Still busy transitioning.
-                    screenState = ScreenState.TransitionOn;
-                }
-                else
-                {
-                    // Transition finished!
-                    screenState = ScreenState.Active;
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Helper for updating the screen transition position.
-        /// </summary>
-        bool UpdateTransition(GameTime gameTime, TimeSpan time, int direction)
-        {
-            // How much should we move by?
-            float transitionDelta;
-
-            if (time == TimeSpan.Zero)
-                transitionDelta = 1;
-            else
-                transitionDelta = (float)(gameTime.ElapsedGameTime.TotalMilliseconds /
-                                          time.TotalMilliseconds);
-
-            // Update the transition position.
-            transitionPosition += transitionDelta * direction;
-
-            // Did we reach the end of the transition?
-            if (((direction < 0) && (transitionPosition <= 0)) ||
-                ((direction > 0) && (transitionPosition >= 1)))
-            {
-                transitionPosition = MathHelper.Clamp(transitionPosition, 0, 1);
-                return false;
-            }
-
-            // Otherwise we are still busy transitioning.
-            return true;
-        }
-
-
-        /// <summary>
-        /// Allows the screen to handle user input. Unlike Update, this method
-        /// is only called when the screen is active, and not when some other
-        /// screen has taken the focus.
-        /// </summary>
-        public virtual void HandleInput(InputState input) { }
-
-
-        /// <summary>
-        /// This is called when the screen should draw itself.
-        /// </summary>
-        public virtual void Draw(GameTime gameTime) { }
-
-
-        #endregion
-
-        #region Public Methods
-
-        /// <summary>
-        /// Tells the screen to serialize its state into the given stream.
-        /// </summary>
-        public virtual void Serialize(Stream stream) { }
-
-        /// <summary>
-        /// Tells the screen to deserialize its state from the given stream.
-        /// </summary>
-        public virtual void Deserialize(Stream stream) { }
-
-        /// <summary>
-        /// Tells the screen to go away. Unlike ScreenManager.RemoveScreen, which
-        /// instantly kills the screen, this method respects the transition timings
-        /// and will give the screen a chance to gradually transition off.
-        /// </summary>
-        public void ExitScreen()
-        {
-            if (TransitionOffTime == TimeSpan.Zero)
-            {
-                // If the screen has a zero transition time, remove it immediately.
-                ScreenManager.RemoveScreen(this);
-            }
-            else
-            {
-                // Otherwise flag that it should transition off and then exit.
-                isExiting = true;
-            }
-        }
-
-
-        #endregion
-
-        #region Helper Methods
-        /// <summary>
-        /// A helper method which loads assets using the screen manager's
-        /// associated game content loader.
-        /// </summary>
-        /// <typeparam name="T">Type of asset.</typeparam>
-        /// <param name="assetName">Asset name, relative to the loader root
-        /// directory, and not including the .xnb extension.</param>
-        /// <returns></returns>
-        public T Load<T>(string assetName)
-        {
-            return ScreenManager.Game.Content.Load<T>(assetName);
-        }
-        #endregion
-    }
-}

+ 0 - 237
StarterKits/iOS/MemoryMadness/ScreenManager/InputState.cs

@@ -1,237 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// InputState.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Input.Touch;
-using System.Collections.Generic;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Helper for reading input from keyboard, gamepad, and touch input. This class 
-    /// tracks both the current and previous state of the input devices, and implements 
-    /// query methods for high level input actions such as "move up through the menu"
-    /// or "pause the game".
-    /// </summary>
-    public class InputState
-    {
-        #region Fields
-
-        public const int MaxInputs = 4;
-
-        public readonly KeyboardState[] CurrentKeyboardStates;
-        public readonly GamePadState[] CurrentGamePadStates;
-
-        public readonly KeyboardState[] LastKeyboardStates;
-        public readonly GamePadState[] LastGamePadStates;
-
-        public readonly bool[] GamePadWasConnected;
-
-        public TouchCollection TouchState;
-
-        public readonly List<GestureSample> Gestures = new List<GestureSample>();
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Constructs a new input state.
-        /// </summary>
-        public InputState()
-        {
-            CurrentKeyboardStates = new KeyboardState[MaxInputs];
-            CurrentGamePadStates = new GamePadState[MaxInputs];
-
-            LastKeyboardStates = new KeyboardState[MaxInputs];
-            LastGamePadStates = new GamePadState[MaxInputs];
-
-            GamePadWasConnected = new bool[MaxInputs];
-        }
-
-
-        #endregion
-
-        #region Public Methods
-
-
-        /// <summary>
-        /// Reads the latest state of the keyboard and gamepad.
-        /// </summary>
-        public void Update()
-        {
-            for (int i = 0; i < MaxInputs; i++)
-            {
-                LastKeyboardStates[i] = CurrentKeyboardStates[i];
-                LastGamePadStates[i] = CurrentGamePadStates[i];
-
-                CurrentKeyboardStates[i] = Keyboard.GetState((PlayerIndex)i);
-                CurrentGamePadStates[i] = GamePad.GetState((PlayerIndex)i);
-
-                // Keep track of whether a gamepad has ever been
-                // connected, so we can detect if it is unplugged.
-                if (CurrentGamePadStates[i].IsConnected)
-                {
-                    GamePadWasConnected[i] = true;
-                }
-            }
-
-            TouchState = TouchPanel.GetState();
-
-            Gestures.Clear();
-            while (TouchPanel.IsGestureAvailable)
-            {
-                Gestures.Add(TouchPanel.ReadGesture());
-            }
-        }
-
-
-        /// <summary>
-        /// Helper for checking if a key was newly pressed during this update. The
-        /// controllingPlayer parameter specifies which player to read input for.
-        /// If this is null, it will accept input from any player. When a keypress
-        /// is detected, the output playerIndex reports which player pressed it.
-        /// </summary>
-        public bool IsNewKeyPress(Keys key, PlayerIndex? controllingPlayer,
-                                            out PlayerIndex playerIndex)
-        {
-            if (controllingPlayer.HasValue)
-            {
-                // Read input from the specified player.
-                playerIndex = controllingPlayer.Value;
-
-                int i = (int)playerIndex;
-
-                return (CurrentKeyboardStates[i].IsKeyDown(key) &&
-                        LastKeyboardStates[i].IsKeyUp(key));
-            }
-            else
-            {
-                // Accept input from any player.
-                return (IsNewKeyPress(key, PlayerIndex.One, out playerIndex) ||
-                        IsNewKeyPress(key, PlayerIndex.Two, out playerIndex) ||
-                        IsNewKeyPress(key, PlayerIndex.Three, out playerIndex) ||
-                        IsNewKeyPress(key, PlayerIndex.Four, out playerIndex));
-            }
-        }
-
-
-        /// <summary>
-        /// Helper for checking if a button was newly pressed during this update.
-        /// The controllingPlayer parameter specifies which player to read input for.
-        /// If this is null, it will accept input from any player. When a button press
-        /// is detected, the output playerIndex reports which player pressed it.
-        /// </summary>
-        public bool IsNewButtonPress(Buttons button, PlayerIndex? controllingPlayer,
-                                                     out PlayerIndex playerIndex)
-        {
-            if (controllingPlayer.HasValue)
-            {
-                // Read input from the specified player.
-                playerIndex = controllingPlayer.Value;
-
-                int i = (int)playerIndex;
-
-                return (CurrentGamePadStates[i].IsButtonDown(button) &&
-                        LastGamePadStates[i].IsButtonUp(button));
-            }
-            else
-            {
-                // Accept input from any player.
-                return (IsNewButtonPress(button, PlayerIndex.One, out playerIndex) ||
-                        IsNewButtonPress(button, PlayerIndex.Two, out playerIndex) ||
-                        IsNewButtonPress(button, PlayerIndex.Three, out playerIndex) ||
-                        IsNewButtonPress(button, PlayerIndex.Four, out playerIndex));
-            }
-        }
-
-
-        /// <summary>
-        /// Checks for a "menu select" input action.
-        /// The controllingPlayer parameter specifies which player to read input for.
-        /// If this is null, it will accept input from any player. When the action
-        /// is detected, the output playerIndex reports which player pressed it.
-        /// </summary>
-        public bool IsMenuSelect(PlayerIndex? controllingPlayer,
-                                 out PlayerIndex playerIndex)
-        {
-            return IsNewKeyPress(Keys.Space, controllingPlayer, out playerIndex) ||
-                   IsNewKeyPress(Keys.Enter, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.A, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.Start, controllingPlayer, out playerIndex);
-        }
-
-
-        /// <summary>
-        /// Checks for a "menu cancel" input action.
-        /// The controllingPlayer parameter specifies which player to read input for.
-        /// If this is null, it will accept input from any player. When the action
-        /// is detected, the output playerIndex reports which player pressed it.
-        /// </summary>
-        public bool IsMenuCancel(PlayerIndex? controllingPlayer,
-                                 out PlayerIndex playerIndex)
-        {
-            return IsNewKeyPress(Keys.Escape, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.B, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.Back, controllingPlayer, out playerIndex);
-        }
-
-
-        /// <summary>
-        /// Checks for a "menu up" input action.
-        /// The controllingPlayer parameter specifies which player to read
-        /// input for. If this is null, it will accept input from any player.
-        /// </summary>
-        public bool IsMenuUp(PlayerIndex? controllingPlayer)
-        {
-            PlayerIndex playerIndex;
-
-            return IsNewKeyPress(Keys.Up, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.DPadUp, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.LeftThumbstickUp, controllingPlayer, out playerIndex);
-        }
-
-
-        /// <summary>
-        /// Checks for a "menu down" input action.
-        /// The controllingPlayer parameter specifies which player to read
-        /// input for. If this is null, it will accept input from any player.
-        /// </summary>
-        public bool IsMenuDown(PlayerIndex? controllingPlayer)
-        {
-            PlayerIndex playerIndex;
-
-            return IsNewKeyPress(Keys.Down, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.DPadDown, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.LeftThumbstickDown, controllingPlayer, out playerIndex);
-        }
-
-
-        /// <summary>
-        /// Checks for a "pause the game" input action.
-        /// The controllingPlayer parameter specifies which player to read
-        /// input for. If this is null, it will accept input from any player.
-        /// </summary>
-        public bool IsPauseGame(PlayerIndex? controllingPlayer)
-        {
-            PlayerIndex playerIndex;
-
-            return IsNewKeyPress(Keys.Escape, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.Back, controllingPlayer, out playerIndex) ||
-                   IsNewButtonPress(Buttons.Start, controllingPlayer, out playerIndex);
-        }
-
-
-        #endregion
-    }
-}

+ 0 - 186
StarterKits/iOS/MemoryMadness/ScreenManager/MenuEntry.cs

@@ -1,186 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// MenuEntry.cs
-//
-// XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Helper class represents a single entry in a MenuScreen. By default this
-    /// just draws the entry text string, but it can be customized to display menu
-    /// entries in different ways. This also provides an event that will be raised
-    /// when the menu entry is selected.
-    /// </summary>
-    class MenuEntry
-    {
-        #region Fields
-
-        /// <summary>
-        /// The text rendered for this entry.
-        /// </summary>
-        string text;
-
-        /// <summary>
-        /// Tracks a fading selection effect on the entry.
-        /// </summary>
-        /// <remarks>
-        /// The entries transition out of the selection effect when they are deselected.
-        /// </remarks>
-        float selectionFade;
-
-        /// <summary>
-        /// The position at which the entry is drawn. This is set by the MenuScreen
-        /// each frame in Update.
-        /// </summary>
-        Vector2 position;
-
-        #endregion
-
-        #region Properties
-
-
-        /// <summary>
-        /// Gets or sets the text of this menu entry.
-        /// </summary>
-        public string Text
-        {
-            get { return text; }
-            set { text = value; }
-        }
-
-        /// <summary>
-        /// Gets or sets the position at which to draw this menu entry.
-        /// </summary>
-        public Vector2 Position
-        {
-            get { return position; }
-            set { position = value; }
-        }
-
-
-        #endregion
-
-        #region Events
-
-
-        /// <summary>
-        /// Event raised when the menu entry is selected.
-        /// </summary>
-        public event EventHandler<PlayerIndexEventArgs> Selected;
-
-
-        /// <summary>
-        /// Method for raising the Selected event.
-        /// </summary>
-        protected internal virtual void OnSelectEntry(PlayerIndex playerIndex)
-        {
-            if (Selected != null)
-                Selected(this, new PlayerIndexEventArgs(playerIndex));
-        }
-
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Constructs a new menu entry with the specified text.
-        /// </summary>
-        public MenuEntry(string text)
-        {
-            this.text = text;
-        }
-
-
-        #endregion
-
-        #region Update and Draw
-
-
-        /// <summary>
-        /// Updates the menu entry.
-        /// </summary>
-        public virtual void Update(MenuScreen screen, bool isSelected, GameTime gameTime)
-        {
-            // there is no such thing as a selected item on Windows Phone, so we always
-            // force isSelected to be false
-#if WINDOWS_PHONE
-            isSelected = false;
-#endif
-
-            // When the menu selection changes, entries gradually fade between
-            // their selected and deselected appearance, rather than instantly
-            // popping to the new state.
-            float fadeSpeed = (float)gameTime.ElapsedGameTime.TotalSeconds * 4;
-
-            if (isSelected)
-                selectionFade = Math.Min(selectionFade + fadeSpeed, 1);
-            else
-                selectionFade = Math.Max(selectionFade - fadeSpeed, 0);
-        }
-
-
-        /// <summary>
-        /// Draws the menu entry. This can be overridden to customize the appearance.
-        /// </summary>
-        public virtual void Draw(MenuScreen screen, bool isSelected, GameTime gameTime)
-        {
-            // there is no such thing as a selected item on Windows Phone, so we always
-            // force isSelected to be false
-            isSelected = false;
-
-            // Draw the selected entry in yellow, otherwise white.
-            Color color = isSelected ? Color.Yellow : Color.Red;
-
-            // Pulsate the size of the selected menu entry.
-            double time = gameTime.TotalGameTime.TotalSeconds;
-            
-            float pulsate = (float)Math.Sin(time * 6) + 1;
-
-            float scale = 1 + pulsate * 0.05f * selectionFade;
-
-            // Modify the alpha to fade text out during transitions.
-            color = new Color(color.R, color.G, color.B) * screen.TransitionAlpha;
-
-            // Draw text, centered on the middle of each line.
-            ScreenManager screenManager = screen.ScreenManager;
-            SpriteBatch spriteBatch = screenManager.SpriteBatch;
-            SpriteFont font = screenManager.Font;
-
-            Vector2 origin = new Vector2(0, font.LineSpacing / 2);
-
-            spriteBatch.DrawString(font, text, position, color, 0,
-                                   origin, scale, SpriteEffects.None, 0);
-        }
-
-
-        /// <summary>
-        /// Queries how much space this menu entry requires.
-        /// </summary>
-        public virtual int GetHeight(MenuScreen screen)
-        {
-            return screen.ScreenManager.Font.LineSpacing;
-        }
-
-        /// <summary>
-        /// Queries how wide the entry is, used for centering on the screen.
-        /// </summary>
-        public virtual int GetWidth(MenuScreen screen)
-        {
-            return (int)screen.ScreenManager.Font.MeasureString(Text).X;
-        }
-
-        #endregion
-    }
-}

+ 0 - 259
StarterKits/iOS/MemoryMadness/ScreenManager/MenuScreen.cs

@@ -1,259 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// MenuScreen.cs
-//
-// XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Input;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Base class for screens that contain a menu of options. The user can
-    /// move up and down to select an entry, or cancel to back out of the screen.
-    /// </summary>
-    abstract class MenuScreen : GameScreen
-    {
-        #region Fields
-
-        // the number of pixels to pad above and below menu entries for touch input
-        const int menuEntryPadding = 23;
-
-        List<MenuEntry> menuEntries = new List<MenuEntry>();
-        int selectedEntry = 0;
-        string menuTitle;
-
-        #endregion
-
-        #region Properties
-
-
-        /// <summary>
-        /// Gets the list of menu entries, so derived classes can add
-        /// or change the menu contents.
-        /// </summary>
-        protected IList<MenuEntry> MenuEntries
-        {
-            get { return menuEntries; }
-        }
-
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        public MenuScreen(string menuTitle)
-        {
-            // menus generally only need Tap for menu selection
-            EnabledGestures = GestureType.Tap;
-
-            this.menuTitle = menuTitle;
-
-            TransitionOnTime = TimeSpan.FromSeconds(0.5);
-            TransitionOffTime = TimeSpan.FromSeconds(0.5);
-        }
-
-
-        #endregion
-
-        #region Handle Input
-
-        /// <summary>
-        /// Allows the screen to create the hit bounds for a particular menu entry.
-        /// </summary>
-        protected virtual Rectangle GetMenuEntryHitBounds(MenuEntry entry)
-        {
-            // the hit bounds are the entire width of the screen, and the height of the entry
-            // with some additional padding above and below.
-            return new Rectangle(
-                0,
-                (int)entry.Position.Y - menuEntryPadding,
-                ScreenManager.GraphicsDevice.Viewport.Width,
-                entry.GetHeight(this) + (menuEntryPadding * 2));
-        }
-
-        /// <summary>
-        /// Responds to user input, changing the selected entry and accepting
-        /// or cancelling the menu.
-        /// </summary>
-        public override void HandleInput(InputState input)
-        {
-            // we cancel the current menu screen if the user presses the back button
-            PlayerIndex player;
-            if (input.IsNewButtonPress(Buttons.Back, ControllingPlayer, out player))
-            {
-                OnCancel(player);
-            }
-
-            // look for any taps that occurred and select any entries that were tapped
-            foreach (GestureSample gesture in input.Gestures)
-            {
-                if (gesture.GestureType == GestureType.Tap)
-                {
-                    // convert the position to a Point that we can test against a Rectangle
-                    Point tapLocation = new Point((int)gesture.Position.X, (int)gesture.Position.Y);
-
-                    // iterate the entries to see if any were tapped
-                    for (int i = 0; i < menuEntries.Count; i++)
-                    {
-                        MenuEntry menuEntry = menuEntries[i];
-
-                        if (GetMenuEntryHitBounds(menuEntry).Contains(tapLocation))
-                        {
-                            // select the entry. since gestures are only available on Windows Phone,
-                            // we can safely pass PlayerIndex.One to all entries since there is only
-                            // one player on Windows Phone.
-                            OnSelectEntry(i, PlayerIndex.One);
-                        }
-                    }
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handler for when the user has chosen a menu entry.
-        /// </summary>
-        protected virtual void OnSelectEntry(int entryIndex, PlayerIndex playerIndex)
-        {
-            menuEntries[entryIndex].OnSelectEntry(playerIndex);
-        }
-
-
-        /// <summary>
-        /// Handler for when the user has cancelled the menu.
-        /// </summary>
-        protected virtual void OnCancel(PlayerIndex playerIndex)
-        {
-            ExitScreen();
-        }
-
-
-        /// <summary>
-        /// Helper overload makes it easy to use OnCancel as a MenuEntry event handler.
-        /// </summary>
-        protected void OnCancel(object sender, PlayerIndexEventArgs e)
-        {
-            OnCancel(e.PlayerIndex);
-        }
-
-
-        #endregion
-
-        #region Update and Draw
-
-
-        /// <summary>
-        /// Allows the screen the chance to position the menu entries. By default
-        /// all menu entries are lined up in a vertical list, centered on the screen.
-        /// </summary>
-        protected virtual void UpdateMenuEntryLocations()
-        {
-            // Make the menu slide into place during transitions, using a
-            // power curve to make things look more interesting (this makes
-            // the movement slow down as it nears the end).
-            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
-
-            // start at Y = 475; each X value is generated per entry
-            Vector2 position = new Vector2(0f, 316f);
-
-            // update each menu entry's location in turn
-            for (int i = 0; i < menuEntries.Count; i++)
-            {
-                MenuEntry menuEntry = menuEntries[i];
-                
-                // each entry is to be centered horizontally
-                position.X = ScreenManager.GraphicsDevice.Viewport.Width / 2 - menuEntry.GetWidth(this) / 2;
-
-                if (ScreenState == ScreenState.TransitionOn)
-                    position.X -= transitionOffset * 256;
-                else
-                    position.X += transitionOffset * 512;
-
-                // set the entry's position
-                menuEntry.Position = position;
-
-                // move down for the next entry the size of this entry plus our padding
-                position.Y += menuEntry.GetHeight(this) + (menuEntryPadding * 2);
-            }
-        }
-
-        /// <summary>
-        /// Updates the menu.
-        /// </summary>
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
-                                                       bool coveredByOtherScreen)
-        {
-            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-
-            // Update each nested MenuEntry object.
-            for (int i = 0; i < menuEntries.Count; i++)
-            {
-                bool isSelected = IsActive && (i == selectedEntry);
-
-                menuEntries[i].Update(this, isSelected, gameTime);
-            }
-        }
-
-
-        /// <summary>
-        /// Draws the menu.
-        /// </summary>
-        public override void Draw(GameTime gameTime)
-        {
-            // make sure our entries are in the right place before we draw them
-            UpdateMenuEntryLocations();
-
-            GraphicsDevice graphics = ScreenManager.GraphicsDevice;
-            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-            SpriteFont font = ScreenManager.Font;
-
-            spriteBatch.Begin();
-
-            // Draw each menu entry in turn.
-            for (int i = 0; i < menuEntries.Count; i++)
-            {
-                MenuEntry menuEntry = menuEntries[i];
-
-                bool isSelected = IsActive && (i == selectedEntry);
-
-                menuEntry.Draw(this, isSelected, gameTime);
-            }
-
-            // Make the menu slide into place during transitions, using a
-            // power curve to make things look more interesting (this makes
-            // the movement slow down as it nears the end).
-            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
-
-            // Draw the menu title centered on the screen
-            Vector2 titlePosition = new Vector2(graphics.Viewport.Width / 2, 375);
-            Vector2 titleOrigin = font.MeasureString(menuTitle) / 2;
-            Color titleColor = new Color(192, 192, 192) * TransitionAlpha;
-            float titleScale = 1.25f;
-
-            titlePosition.Y -= transitionOffset * 100;
-
-            spriteBatch.DrawString(font, menuTitle, titlePosition, titleColor, 0,
-                                   titleOrigin, titleScale, SpriteEffects.None, 0);
-
-            spriteBatch.End();
-        }
-
-
-        #endregion
-    }
-}

+ 0 - 42
StarterKits/iOS/MemoryMadness/ScreenManager/PlayerIndexEventArgs.cs

@@ -1,42 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// PlayerIndexEventArgs.cs
-//
-// XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using Microsoft.Xna.Framework;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Custom event argument which includes the index of the player who
-    /// triggered the event. This is used by the MenuEntry.Selected event.
-    /// </summary>
-    class PlayerIndexEventArgs : EventArgs
-    {
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        public PlayerIndexEventArgs(PlayerIndex playerIndex)
-        {
-            this.playerIndex = playerIndex;
-        }
-
-
-        /// <summary>
-        /// Gets the index of the player who triggered this event.
-        /// </summary>
-        public PlayerIndex PlayerIndex
-        {
-            get { return playerIndex; }
-        }
-
-        PlayerIndex playerIndex;
-    }
-}

+ 0 - 453
StarterKits/iOS/MemoryMadness/ScreenManager/ScreenManager.cs

@@ -1,453 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// ScreenManager.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Diagnostics;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-using System.IO;
-using System.IO.IsolatedStorage;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// The screen manager is a component which manages one or more GameScreen
-    /// instances. It maintains a stack of screens, calls their Update and Draw
-    /// methods at the appropriate times, and automatically routes input to the
-    /// topmost active screen.
-    /// </summary>
-    public class ScreenManager : DrawableGameComponent
-    {
-        #region Fields
-
-        List<GameScreen> screens = new List<GameScreen>();
-        List<GameScreen> screensToUpdate = new List<GameScreen>();
-
-        InputState input = new InputState();
-
-        SpriteBatch spriteBatch;
-        SpriteFont font;
-        Texture2D blankTexture;
-
-        bool isInitialized;
-
-        bool traceEnabled;
-
-        #endregion
-
-        #region Properties
-
-
-        /// <summary>
-        /// A default SpriteBatch shared by all the screens. This saves
-        /// each screen having to bother creating their own local instance.
-        /// </summary>
-        public SpriteBatch SpriteBatch
-        {
-            get { return spriteBatch; }
-        }
-
-
-        /// <summary>
-        /// A default font shared by all the screens. This saves
-        /// each screen having to bother loading their own local copy.
-        /// </summary>
-        public SpriteFont Font
-        {
-            get { return font; }
-        }
-
-
-        /// <summary>
-        /// If true, the manager prints out a list of all the screens
-        /// each time it is updated. This can be useful for making sure
-        /// everything is being added and removed at the right times.
-        /// </summary>
-        public bool TraceEnabled
-        {
-            get { return traceEnabled; }
-            set { traceEnabled = value; }
-        }
-
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Constructs a new screen manager component.
-        /// </summary>
-        public ScreenManager(Game game)
-            : base(game)
-        {
-            // we must set EnabledGestures before we can query for them, but
-            // we don't assume the game wants to read them.
-            TouchPanel.EnabledGestures = GestureType.None;
-        }
-
-
-        /// <summary>
-        /// Initializes the screen manager component.
-        /// </summary>
-        public override void Initialize()
-        {
-            base.Initialize();
-
-            isInitialized = true;
-        }
-
-
-        /// <summary>
-        /// Load your graphics content.
-        /// </summary>
-        protected override void LoadContent()
-        {
-            // Load content belonging to the screen manager.
-            ContentManager content = Game.Content;
-
-            spriteBatch = new SpriteBatch(GraphicsDevice);
-            blankTexture = content.Load<Texture2D>("Textures/Backgrounds/blank");
-			font = content.Load<SpriteFont>("Fonts/MenuFont");
-            
-
-            // Tell each of the screens to load their content.
-            foreach (GameScreen screen in screens)
-            {
-                screen.LoadContent();
-            }
-        }
-
-
-        /// <summary>
-        /// Unload your graphics content.
-        /// </summary>
-        protected override void UnloadContent()
-        {
-            // Tell each of the screens to unload their content.
-            foreach (GameScreen screen in screens)
-            {
-                screen.UnloadContent();
-            }
-        }
-
-
-        #endregion
-
-        #region Update and Draw
-
-
-        /// <summary>
-        /// Allows each screen to run logic.
-        /// </summary>
-        public override void Update(GameTime gameTime)
-        {
-            // Read the keyboard and gamepad.
-            input.Update();
-
-            // Make a copy of the master screen list, to avoid confusion if
-            // the process of updating one screen adds or removes others.
-            screensToUpdate.Clear();
-
-            foreach (GameScreen screen in screens)
-                screensToUpdate.Add(screen);
-
-            bool otherScreenHasFocus = !Game.IsActive;
-            bool coveredByOtherScreen = false;
-
-            // Loop as long as there are screens waiting to be updated.
-            while (screensToUpdate.Count > 0)
-            {
-                // Pop the topmost screen off the waiting list.
-                GameScreen screen = screensToUpdate[screensToUpdate.Count - 1];
-
-                screensToUpdate.RemoveAt(screensToUpdate.Count - 1);
-
-                // Update the screen.
-                screen.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-
-                if (screen.ScreenState == ScreenState.TransitionOn ||
-                    screen.ScreenState == ScreenState.Active)
-                {
-                    // If this is the first active screen we came across,
-                    // give it a chance to handle input.
-                    if (!otherScreenHasFocus)
-                    {
-                        screen.HandleInput(input);
-
-                        otherScreenHasFocus = true;
-                    }
-
-                    // If this is an active non-popup, inform any subsequent
-                    // screens that they are covered by it.
-                    if (!screen.IsPopup)
-                        coveredByOtherScreen = true;
-                }
-            }
-
-            // Print debug trace?
-            if (traceEnabled)
-                TraceScreens();
-        }
-
-
-        /// <summary>
-        /// Prints a list of all the screens, for debugging.
-        /// </summary>
-        void TraceScreens()
-        {
-            List<string> screenNames = new List<string>();
-
-            foreach (GameScreen screen in screens)
-                screenNames.Add(screen.GetType().Name);
-
-            Debug.WriteLine(string.Join(", ", screenNames.ToArray()));
-        }
-
-
-        /// <summary>
-        /// Tells each screen to draw itself.
-        /// </summary>
-        public override void Draw(GameTime gameTime)
-        {
-            foreach (GameScreen screen in screens)
-            {
-                if (screen.ScreenState == ScreenState.Hidden)
-                    continue;
-
-                screen.Draw(gameTime);
-            }
-        }
-
-
-        #endregion
-
-        #region Public Methods
-
-
-        /// <summary>
-        /// Adds a new screen to the screen manager.
-        /// </summary>
-        public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer)
-        {
-            screen.ControllingPlayer = controllingPlayer;
-            screen.ScreenManager = this;
-            screen.IsExiting = false;
-
-            // If we have a graphics device, tell the screen to load content.
-            if (isInitialized)
-            {
-                screen.LoadContent();
-            }
-
-            screens.Add(screen);
-
-            // update the TouchPanel to respond to gestures this screen is interested in
-            TouchPanel.EnabledGestures = screen.EnabledGestures;
-        }
-
-
-        /// <summary>
-        /// Removes a screen from the screen manager. You should normally
-        /// use GameScreen.ExitScreen instead of calling this directly, so
-        /// the screen can gradually transition off rather than just being
-        /// instantly removed.
-        /// </summary>
-        public void RemoveScreen(GameScreen screen)
-        {
-            // If we have a graphics device, tell the screen to unload content.
-            if (isInitialized)
-            {
-                screen.UnloadContent();
-            }
-
-            screens.Remove(screen);
-            screensToUpdate.Remove(screen);
-
-            // if there is a screen still in the manager, update TouchPanel
-            // to respond to gestures that screen is interested in.
-            if (screens.Count > 0)
-            {
-                TouchPanel.EnabledGestures = screens[screens.Count - 1].EnabledGestures;
-            }
-        }
-
-
-        /// <summary>
-        /// Expose an array holding all the screens. We return a copy rather
-        /// than the real master list, because screens should only ever be added
-        /// or removed using the AddScreen and RemoveScreen methods.
-        /// </summary>
-        public GameScreen[] GetScreens()
-        {
-            return screens.ToArray();
-        }
-
-
-        /// <summary>
-        /// Helper draws a translucent black fullscreen sprite, used for fading
-        /// screens in and out, and for darkening the background behind popups.
-        /// </summary>
-        public void FadeBackBufferToBlack(float alpha)
-        {
-            Viewport viewport = GraphicsDevice.Viewport;
-
-            spriteBatch.Begin();
-
-            spriteBatch.Draw(blankTexture,
-                             new Rectangle(0, 0, viewport.Width, viewport.Height),
-                             Color.Black * alpha);
-
-            spriteBatch.End();
-        }
-
-        /// <summary>
-        /// Informs the screen manager to serialize its state to disk.
-        /// </summary>
-        public void SerializeState()
-        {
-            // open up isolated storage
-            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // if our screen manager directory already exists, delete the contents
-/*                if (storage.DirectoryExists("ScreenManager"))
-                {
-                    DeleteState(storage);
-                }
-
-                // otherwise just create the directory
-                else
-  */              {
-                    storage.CreateDirectory("ScreenManager");
-                }
-
-          /*      // create a file we'll use to store the list of screens in the stack
-                using (IsolatedStorageFileStream stream = storage.CreateFile("ScreenManager\\ScreenList.dat"))
-                {
-                    using (BinaryWriter writer = new BinaryWriter(stream))
-                    {
-                        // write out the full name of all the types in our stack so we can
-                        // recreate them if needed.
-                        foreach (GameScreen screen in screens)
-                        {
-                            if (screen.IsSerializable)
-                            {
-                                writer.Write(screen.GetType().AssemblyQualifiedName);
-                            }
-                        }
-                    }
-                } */
-
-                // now we create a new file stream for each screen so it can save its state
-                // if it needs to. we name each file "ScreenX.dat" where X is the index of
-                // the screen in the stack, to ensure the files are uniquely named
-                int screenIndex = 0;
-                foreach (GameScreen screen in screens)
-                {
-                    if (screen.IsSerializable)
-                    {
-                        string fileName = string.Format("ScreenManager\\Screen{0}.dat", screenIndex);
-
-                        // open up the stream and let the screen serialize whatever state it wants
-                       /* using (IsolatedStorageFileStream stream = storage.CreateFile(fileName))
-                        {
-                            screen.Serialize(stream);
-                        }
-                        */
-
-                        screenIndex++;
-                    }
-                }
-            }
-        }
-
-        public bool DeserializeState()
-        {
-            // open up isolated storage
-            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // see if our saved state directory exists
-                /*if (storage.DirectoryExists("ScreenManager"))
-                {
-                    try
-                    {
-                        // see if we have a screen list
-                        if (storage.FileExists("ScreenManager\\ScreenList.dat"))
-                        {
-                            // load the list of screen types
-                            using (IsolatedStorageFileStream stream = 
-                                storage.OpenFile("ScreenManager\\ScreenList.dat", FileMode.Open, 
-                                FileAccess.Read))
-                            {
-                                using (BinaryReader reader = new BinaryReader(stream))
-                                {
-                                    while (reader.BaseStream.Position < reader.BaseStream.Length)
-                                    {
-                                        // read a line from our file
-                                        string line = reader.ReadString();
-
-                                        // if it isn't blank, we can create a screen from it
-                                        if (!string.IsNullOrEmpty(line))
-                                        {
-                                            Type screenType = Type.GetType(line);
-                                            GameScreen screen = Activator.CreateInstance(screenType) as GameScreen;
-                                            AddScreen(screen, PlayerIndex.One);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        // next we give each screen a chance to deserialize from the disk
-                        for (int i = 0; i < screens.Count; i++)
-                        {
-                            string filename = string.Format("ScreenManager\\Screen{0}.dat", i);
-                            using (IsolatedStorageFileStream stream = storage.OpenFile(filename, 
-                                FileMode.Open, FileAccess.Read))
-                            {
-                                screens[i].Deserialize(stream);
-                            }
-                        }
-
-                        return true;
-                    }
-                    catch (Exception)
-                    {
-                        // if an exception was thrown while reading, odds are we cannot recover
-                        // from the saved state, so we will delete it so the game can correctly
-                        // launch.
-                        DeleteState(storage);
-                    }
-                }*/
-            }
-
-            return false;
-        }
-
-        /// <summary>
-        /// Deletes the saved state files from isolated storage.
-        /// </summary>
-        private void DeleteState(IsolatedStorageFile storage)
-        {
-            // get all of the files in the directory and delete them
-            string[] files = storage.GetFileNames("ScreenManager\\*");
-            foreach (string file in files)
-            {
-                storage.DeleteFile(Path.Combine("ScreenManager", file));
-            }
-        }
-
-        #endregion
-    }
-}

+ 0 - 174
StarterKits/iOS/MemoryMadness/Screens/BackgroundScreen.cs

@@ -1,174 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// BackgroundScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using GameStateManagement;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class BackgroundScreen : GameScreen
-    {
-        #region Fields
-
-        Texture2D background;
-        Texture2D leftDoor;
-        Texture2D rightDoor;
-
-        Vector2 leftDoorPosition;
-        Vector2 rightDoorPosition;
-
-        bool animateDoors;
-        bool doorsInTranistion;
-        bool doorsHitFinalPosition = false;
-        bool doorsBounceStarted = false;
-
-        #endregion
-
-        #region Initialization
-
-        public BackgroundScreen(bool animateDoors)
-        {
-            TransitionOnTime = TimeSpan.FromSeconds(0.0);
-            TransitionOffTime = TimeSpan.FromSeconds(0.5);
-
-            this.animateDoors = animateDoors;
-            if (animateDoors)
-            {
-                AudioManager.PlaySound("doorOpen");
-            }
-        }
-
-        #endregion
-
-        #region Loading
-
-        /// <summary>
-        /// Load screen resources
-        /// </summary>
-        public override void LoadContent()
-        {
-            background = Load<Texture2D>(@"Textures\Backgrounds\titleBG");
-            leftDoor = Load<Texture2D>(@"Textures\Backgrounds\leftDoor");
-            rightDoor = Load<Texture2D>(@"Textures\Backgrounds\rightDoor");
-
-            // Prepare to run the doors' animation
-            if (animateDoors)
-                doorsInTranistion = true;
-
-            // Set the doors' start position
-            leftDoorPosition = Settings.LeftDoorClosedPosition;
-            rightDoorPosition = Settings.RightDoorClosedPosition;
-        }
-
-        #endregion
-
-        #region Update
-
-        /// <summary>
-        /// Update the screen
-        /// </summary>
-        /// <param name="gameTime">The game time</param>
-        /// <param name="otherScreenHasFocus"></param>
-        /// <param name="coveredByOtherScreen"></param>
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
-                            bool coveredByOtherScreen)
-        {
-            if (doorsInTranistion && animateDoors)
-                AnimateDoors();
-
-            base.Update(gameTime, otherScreenHasFocus, false);
-        }
-
-        private void AnimateDoors()
-        {
-            if (!doorsHitFinalPosition || doorsBounceStarted)
-            {
-                // Update door X positions between the opened and closed states
-                leftDoorPosition.X = MathHelper.Clamp(
-                    leftDoorPosition.X - Settings.DoorsAnimationStep,
-                    Settings.LeftDoorOpenedPosition.X,
-                    Settings.LeftDoorClosedPosition.X);
-
-
-                rightDoorPosition.X = MathHelper.Clamp(
-                    rightDoorPosition.X + Settings.DoorsAnimationStep,
-                    Settings.RightDoorClosedPosition.X,
-                    Settings.RightDoorOpenedPosition.X);
-
-                // If both doors reach their final position, raise a flag
-                if (leftDoorPosition == Settings.LeftDoorOpenedPosition &&
-                    rightDoorPosition == Settings.RightDoorOpenedPosition)
-                {
-                    if (!doorsHitFinalPosition)
-                        doorsHitFinalPosition = true;
-                    else
-                        doorsInTranistion = false;
-                }
-            }
-            else if (doorsHitFinalPosition)
-            {              
-                // Move the doors back towards their original opened position slightly 
-                // to create a bouncing effect
-                leftDoorPosition.X = MathHelper.Clamp(
-                    leftDoorPosition.X + Settings.DoorsAnimationStep / 2,
-                    Settings.LeftDoorOpenedPosition.X,
-                    Settings.LeftDoorOpenedPosition.X + Settings.DoorsAnimationStep * 3);
-
-
-                rightDoorPosition.X = MathHelper.Clamp(
-                    rightDoorPosition.X - Settings.DoorsAnimationStep / 2,
-                    Settings.RightDoorOpenedPosition.X - Settings.DoorsAnimationStep * 3,
-                    Settings.RightDoorOpenedPosition.X);
-
-                if ((leftDoorPosition.X == Settings.LeftDoorOpenedPosition.X +
-                    Settings.DoorsAnimationStep * 3) &&
-                    (rightDoorPosition.X == Settings.RightDoorOpenedPosition.X -
-                    Settings.DoorsAnimationStep * 3))
-                {
-                    doorsBounceStarted = true;
-                }
-            }
-        }
-
-        #endregion
-
-        #region Render
-
-        /// <summary>
-        /// Renders the screen
-        /// </summary>
-        /// <param name="gameTime"></param>
-        public override void Draw(GameTime gameTime)
-        {
-            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-
-            spriteBatch.Begin();
-
-            // Draw background
-            spriteBatch.Draw(background, new Vector2(0, 0),
-                 Color.White * TransitionAlpha);
-
-            // Draw the doors
-            spriteBatch.Draw(leftDoor, leftDoorPosition, Color.White * TransitionAlpha);
-            spriteBatch.Draw(rightDoor, rightDoorPosition, Color.White * TransitionAlpha);
-
-            spriteBatch.End();
-        }
-
-        #endregion
-    }
-}

+ 0 - 454
StarterKits/iOS/MemoryMadness/Screens/GameplayScreen.cs

@@ -1,454 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// GameplayScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using GameStateManagement;
-using Microsoft.Xna.Framework.GamerServices;
-using System.Xml.Linq;
-using Microsoft.Xna.Framework.Input.Touch;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class GameplayScreen : GameScreen
-    {
-        #region Fields
-
-        private bool isActive;
-
-        private bool isLevelChange;
-
-        /// <summary>
-        /// Sets/gets whether or not the game is active. Set operations propogate
-        /// to the current level.
-        /// </summary>
-        public new bool IsActive
-        {
-            get { return isActive; }
-            set
-            {
-                isActive = value;
-
-                if (null != currentLevel)
-                    currentLevel.IsActive = value;
-            }
-        }
-
-        bool moveToHighScore = false;
-
-        // Gameplay variables        
-        public Level currentLevel;
-        int currentLevelNumber;
-        int movesPerformed = 0;
-
-        int maxLevelNumber;
-
-        // Rendering variables
-        SpriteFont levelNumberFont;
-        SpriteFont textFont;
-        Texture2D background;
-        Texture2D buttonsTexture;
-
-        // Input related variables
-        TimeSpan inputTimeMeasure;
-        TimeSpan inputGracePeriod = TimeSpan.FromMilliseconds(150);
-        TouchInputState inputState = TouchInputState.Idle;
-        List<TouchLocation> lastPressInput;
-
-        #endregion
-
-        #region Initializations
-
-        public GameplayScreen(int levelNumber, int movesPerformed)
-            : this(levelNumber)
-        {
-            this.movesPerformed = movesPerformed;
-        }
-        public GameplayScreen(int levelNumber)
-        {
-            TransitionOnTime = TimeSpan.FromSeconds(0.0);
-            TransitionOffTime = TimeSpan.FromSeconds(0.0);
-
-            currentLevelNumber = levelNumber;
-        }
-
-        #endregion
-
-        #region Loading
-
-        /// <summary>
-        /// Load the game content
-        /// </summary>
-        public override void LoadContent()
-        {
-            XDocument doc = XDocument.Load(@"Content\Gameplay\LevelDefinitions.xml");
-            var levels = doc.Document.Descendants(XName.Get("Level"));
-            foreach (var level in levels)
-            {
-                maxLevelNumber++;
-            }
-
-            // Resolution for a possible situation which can occur while debugging the 
-            // game. The game may remember it is on a level which is higher than the
-            // highest available level, following a change to the definition file.
-            if (currentLevelNumber > maxLevelNumber)
-                currentLevelNumber = 1;
-
-            InitializeLevel();
-
-            base.LoadContent();
-        }
-
-        /// <summary>
-        /// Initialize the level portrayed by the gameplay screen.
-        /// </summary>
-        private void InitializeLevel()
-        {
-            currentLevel = new Level(ScreenManager.Game,
-                         ScreenManager.SpriteBatch,
-                         currentLevelNumber, movesPerformed, buttonsTexture);
-            currentLevel.IsActive = true;
-
-            ScreenManager.Game.Components.Add(currentLevel);
-        }
-
-        /// <summary>
-        /// Load assets used by the gameplay screen.
-        /// </summary>
-        public void LoadAssets()
-        {
-            levelNumberFont =
-                ScreenManager.Game.Content.Load<SpriteFont>(@"Fonts\GameplayLargeFont");
-            textFont =
-                ScreenManager.Game.Content.Load<SpriteFont>(@"Fonts\GameplaySmallFont");
-            background =
-                ScreenManager.Game.Content.Load<Texture2D>(
-                    @"Textures\Backgrounds\gameplayBG");
-            buttonsTexture =
-                ScreenManager.Game.Content.Load<Texture2D>(@"Textures\ButtonStates");
-        }
-
-        #endregion
-
-        #region Update
-        /// <summary>
-        /// Handle user input.
-        /// </summary>
-        /// <param name="input">The input to handle.</param>
-        public override void HandleInput(InputState input)
-        {
-            if (IsActive)
-            {
-                if (input == null)
-                    throw new ArgumentNullException("input");
-
-                if (input.IsPauseGame(null))
-                {
-                    PauseCurrentGame();
-                }
-
-                if (input.TouchState.Count > 0)
-                {
-                    // We are about to handle touch input
-                    switch (inputState)
-                    {
-                        case TouchInputState.Idle:
-                            // We have yet to receive input, start grace period
-                            inputTimeMeasure = TimeSpan.Zero;
-                            inputState = TouchInputState.GracePeriod;
-                            lastPressInput = new List<TouchLocation>();
-                            foreach (var touch in input.TouchState)
-                            {
-                                if (touch.State == TouchLocationState.Pressed)
-                                {
-                                    lastPressInput.Add(touch);
-                                }
-                            }
-                            break;
-                        case TouchInputState.GracePeriod:
-                            // Do nothing during the grace period other than remembering 
-                            // additional presses
-                            foreach (var touch in input.TouchState)
-                            {
-                                if (touch.State == TouchLocationState.Pressed)
-                                {
-                                    lastPressInput.Add(touch);
-                                }
-                            }
-                            break;
-                        default:
-                            break;
-                    }
-                }
-            }
-        }
-
-        /// <summary>
-        /// Update all the game component
-        /// </summary>
-        /// <param name="gameTime"></param>
-        /// <param name="otherScreenHasFocus"></param>
-        /// <param name="coveredByOtherScreen"></param>
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
-        {
-            // Do not advance to the highscore screen if sounds are playing
-            if (moveToHighScore && !AudioManager.AreSoundsPlaying())
-            {
-                ScreenManager.Game.Components.Remove(currentLevel);
-
-                foreach (GameScreen screen in ScreenManager.GetScreens())
-                    screen.ExitScreen();
-
-                ScreenManager.AddScreen(new BackgroundScreen(true), null);
-                ScreenManager.AddScreen(new HighScoreScreen(), null);
-            }
-
-            // Do not perform advance update logic if the game is inactive or we are
-            // moving to the highscore screen
-            if (!IsActive || moveToHighScore)
-            {
-                base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-                return;
-            }
-
-            if ((inputState == TouchInputState.GracePeriod) && (isActive))
-            {
-                inputTimeMeasure += gameTime.ElapsedGameTime;
-
-                // if the input grace period is over, handle the touch input
-                if (inputTimeMeasure >= inputGracePeriod)
-                {
-                    currentLevel.RegisterTouch(lastPressInput);
-                    inputState = TouchInputState.Idle;
-                }
-            }
-
-            // If the user passed the level, advance to the next or finish the game if
-            // the current level was last
-            if (currentLevel.CurrentState == LevelState.FinishedOk && isActive)
-            {
-                AudioManager.PlaySound("success");
-
-                if (currentLevelNumber < maxLevelNumber)
-                {
-                    currentLevelNumber++;
-                    isLevelChange = true;
-                }
-                else
-                {
-                    FinishCurrentGame();
-                }
-            }
-            // If the user failed to pass the level, revert to level one, allowing the
-            // user to register a highscore if he reached a high enough level
-            else if (currentLevel.CurrentState == LevelState.FinishedFail)
-            {               
-                isActive = false;
-
-                if (HighScoreScreen.IsInHighscores(currentLevelNumber))
-                {
-                    // The player has a highscore - show the device's keyboard
-                    Guide.BeginShowKeyboardInput(PlayerIndex.One,
-                        Constants.HighscorePopupTitle, Constants.HighscorePopupText,
-                        Constants.HighscorePopupDefault, ShowHighscorePromptEnded,
-                        false);
-                }
-                else
-                {
-                    AudioManager.PlaySound("fail");
-                    isActive = true;
-                    currentLevelNumber = 1;
-                    isLevelChange = true;
-                }
-            }
-
-            if (isLevelChange)
-            {
-                ScreenManager.Game.Components.Remove(currentLevel);
-
-                currentLevel = new Level(ScreenManager.Game,
-                                            ScreenManager.SpriteBatch,
-                                            currentLevelNumber, buttonsTexture);
-                currentLevel.IsActive = true;
-
-                ScreenManager.Game.Components.Add(currentLevel);
-
-                isLevelChange = false;
-            }
-
-            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-        }
-
-        #endregion
-
-        #region Render
-
-        /// <summary>
-        /// Draw The gameplay screen
-        /// </summary>
-        /// <param name="gameTime"></param>
-        public override void Draw(GameTime gameTime)
-        {
-            ScreenManager.GraphicsDevice.Clear(Color.CornflowerBlue);
-            ScreenManager.SpriteBatch.Begin();
-
-            ScreenManager.SpriteBatch.Draw(background, Vector2.Zero, Color.White);
-
-            if (IsActive)
-            {
-                string text;
-                Vector2 size;
-                Vector2 position;
-
-                if (currentLevel.CurrentState == LevelState.NotReady)
-                {
-                    text = "Preparing...";
-                    size = textFont.MeasureString(text);
-                    position = new Vector2((ScreenManager.GraphicsDevice.Viewport.Width - size.X) / 2,
-                        (ScreenManager.GraphicsDevice.Viewport.Height - size.Y) / 2);
-                    position.X += 20f;
-                    ScreenManager.SpriteBatch.DrawString(textFont, text,
-                        position, Color.White, 0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0f);
-                }
-                else
-                {
-                    // Draw the current level text, with the text color representing the
-                    // game's current state
-
-                    Color levelColor = Color.White;
-
-                    switch (currentLevel.CurrentState)
-                    {
-                        case LevelState.NotReady:
-                        case LevelState.Ready:
-                            break;
-                        case LevelState.Flashing:
-                            levelColor = Color.Yellow;
-                            break;
-                        case LevelState.Started:
-                        case LevelState.Success:
-                        case LevelState.InProcess:
-                        case LevelState.FinishedOk:
-                            levelColor = Color.LimeGreen;
-                            break;
-                        case LevelState.Fault:
-                        case LevelState.FinishedFail:
-                            levelColor = Color.Red;
-                            break;
-                        default:
-                            break;
-                    }
-
-                    // Draw "Level" text
-                    text = "Level";
-                    size = textFont.MeasureString(text);
-                    position = new Vector2(70, (
-                        ScreenManager.GraphicsDevice.Viewport.Height - size.Y) / 2);
-
-                    ScreenManager.SpriteBatch.DrawString(
-                        textFont, text, position, levelColor);
-
-                    // Draw level number
-                    text = currentLevelNumber.ToString("D2");
-                    size = levelNumberFont.MeasureString(text);
-                    position = new Vector2(290, (
-                        ScreenManager.GraphicsDevice.Viewport.Height - size.Y) / 2);
-
-                    ScreenManager.SpriteBatch.DrawString(
-                        levelNumberFont, text, position, levelColor);
-                }
-            }
-
-            ScreenManager.SpriteBatch.End();
-
-            base.Draw(gameTime);
-        }
-
-        #endregion
-
-        #region Private functions
-
-        /// <summary>
-        /// Finish the current game
-        /// </summary>
-        private void FinishCurrentGame()
-        {
-            isActive = false;
-
-            if (HighScoreScreen.IsInHighscores(currentLevelNumber))
-            {
-                // Show the device's keyboard to enter a name for the highscore
-                Guide.BeginShowKeyboardInput(PlayerIndex.One,
-                    Constants.HighscorePopupTitle, Constants.HighscorePopupText,
-                    Constants.HighscorePopupDefault, ShowHighscorePromptEnded, true);
-            }
-            else
-            {
-                moveToHighScore = true;
-            }
-        }
-
-        /// <summary>
-        /// Asynchronous handler for the highscore player name popup messagebox.
-        /// </summary>
-        /// <param name="result">The popup messagebox result. The result's
-        /// AsyncState property should be true if the user successfully finished
-        /// the game, or false otherwise.</param>
-        private void ShowHighscorePromptEnded(IAsyncResult result)
-        {
-            string playerName = Guide.EndShowKeyboardInput(result);
-
-            bool finishedGame = (bool)result.AsyncState;
-
-            if (playerName != null)
-            {
-                if (playerName.Length > 15)
-                    playerName = playerName.Substring(0, 15);
-
-                HighScoreScreen.PutHighScore(playerName, currentLevelNumber);
-            }
-
-            if (finishedGame)
-            {
-                moveToHighScore = true;
-            }
-            else
-            {
-                AudioManager.PlaySound("fail");
-                isActive = true;
-                currentLevelNumber = 1;
-                isLevelChange = true;
-            }
-        }
-
-        /// <summary>
-        /// Pause the game.
-        /// </summary>
-        private void PauseCurrentGame()
-        {
-            IsActive = false;
-
-            // Pause sounds
-            AudioManager.PauseResumeSounds(false);
-
-            ScreenManager.AddScreen(new BackgroundScreen(false), null);
-            ScreenManager.AddScreen(new PauseScreen(false), null);
-        }
-
-        #endregion
-    }
-}

+ 0 - 279
StarterKits/iOS/MemoryMadness/Screens/HighScoreScreen.cs

@@ -1,279 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// LoadingScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using System.Collections.Generic;
-using System.IO.IsolatedStorage;
-using System.IO;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-using Microsoft.Xna.Framework.Input.Touch;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class HighScoreScreen : GameScreen
-    {
-        #region Fields
-
-        // define default highscore table
-        const int highscorePlaces = 10;
-        public static List<KeyValuePair<string, int>> highScore = 
-            new List<KeyValuePair<string, int>>(highscorePlaces)
-        {
-            new KeyValuePair<string, int>("Jasper",10),
-            new KeyValuePair<string, int>("Ellen",9),
-            new KeyValuePair<string, int>("Terry",8),
-            new KeyValuePair<string, int>("Lori",7),
-            new KeyValuePair<string, int>("Michael",6),
-            new KeyValuePair<string, int>("Carol",5),
-            new KeyValuePair<string, int>("Toni",4),
-            new KeyValuePair<string, int>("Cassie",3),
-            new KeyValuePair<string, int>("Luca",2),
-            new KeyValuePair<string, int>("Brian",1)
-        };
-
-        SpriteFont highScoreFont;
-
-        #endregion
-
-        #region Initialzations
-
-        public HighScoreScreen()
-        {
-            EnabledGestures = GestureType.Tap;
-        }
-
-        #endregion
-
-        #region Loading
-
-        /// <summary>
-        /// Load screen resources.
-        /// </summary>
-        public override void LoadContent()
-        {
-            highScoreFont = Load<SpriteFont>(@"Fonts\HighScoresFont");
-
-            base.LoadContent();
-        }
-
-        #endregion
-
-        #region Handle Input
-
-        /// <summary>
-        /// Handles user input as a part of screen logic update
-        /// </summary>
-        /// <param name="input"></param>
-        public override void HandleInput(InputState input)
-        {
-            if (input == null)
-                throw new ArgumentNullException("input");
-
-            if (input.IsPauseGame(null))
-            {
-                Exit();
-            }
-
-            // Return to the main menu when a tap gesture is recognized
-            if (input.Gestures.Count > 0)
-            {
-                GestureSample sample = input.Gestures[0];
-                if (sample.GestureType == GestureType.Tap)
-                {
-                    Exit();
-
-                    input.Gestures.Clear();
-                }
-            }
-        }
-
-        /// <summary>
-        /// Exit this screen
-        /// </summary>
-        private void Exit()
-        {
-            this.ExitScreen();
-            ScreenManager.AddScreen(new BackgroundScreen(false), null);
-            ScreenManager.AddScreen(new MainMenuScreen(), null);
-        }
-
-        #endregion
-
-        #region Render
-
-        /// <summary>
-        /// Renders the screen
-        /// </summary>
-        /// <param name="gameTime"></param>
-        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
-        {
-            ScreenManager.SpriteBatch.Begin();
-
-            // Draw the title
-            string text = "High Scores";
-            var textSize = highScoreFont.MeasureString(text);
-            var position = new Vector2(
-                ScreenManager.GraphicsDevice.Viewport.Width / 2 - textSize.X / 2,
-                340);
-
-            ScreenManager.SpriteBatch.DrawString(highScoreFont, text, 
-                position, Color.Red);
-
-            // Draw the highscores table
-            for (int i = 0; i < highScore.Count; i++)
-            {
-                ScreenManager.SpriteBatch.DrawString(highScoreFont, 
-                    String.Format("{0,2}. {1}", i + 1, highScore[i].Key),
-                    new Vector2(50, i * 40 + position.Y + 40), Color.YellowGreen);
-                ScreenManager.SpriteBatch.DrawString(highScoreFont, 
-                    highScore[i].Value.ToString(),
-                    new Vector2(370, i * 40 + position.Y + 40), 
-                    Color.YellowGreen);
-            }
-
-            ScreenManager.SpriteBatch.End();
-
-            base.Draw(gameTime);
-        }
-
-        #endregion
-
-        #region Highscore loading/saving logic
-
-        /// <summary>
-        /// Check if a score belongs on the high score table
-        /// </summary>
-        /// <returns></returns>
-        public static bool IsInHighscores(int level)
-        {
-            // If the score is higher than the worst score in the table
-            return level > highScore[highscorePlaces - 1].Value;
-        }
-
-        /// <summary>
-        /// Put high score on highscores table
-        /// </summary>
-        /// <param name="name">Name of the player who achieved the highscore.</param>
-        /// <param name="level">The level the player reached.</param>
-        public static void PutHighScore(string playerName, int level)
-        {
-            if (IsInHighscores(level))
-            {
-                highScore[highscorePlaces - 1] = 
-                    new KeyValuePair<string, int>(playerName, level);
-                OrderGameScore();
-            }
-        }
-
-        /// <summary>
-        /// Order the high scores table.
-        /// </summary>
-        private static void OrderGameScore()
-        {
-            highScore.Sort(CompareScores);
-        }
-
-        /// <summary>
-        /// Comparison method used to compare two highscore entries.
-        /// </summary>
-        /// <param name="score1">First highscore entry.</param>
-        /// <param name="score2">Second highscore entry.</param>
-        /// <returns>1 if the first highscore is smaller than the second, 0 if both
-        /// are equal and -1 otherwise.</returns>
-        private static int CompareScores(KeyValuePair<string, int> score1, 
-            KeyValuePair<string, int> score2)
-        {
-            if (score1.Value < score2.Value)
-            {
-                return 1;
-            }
-
-            if (score1.Value == score2.Value)
-            {
-                return 0;
-            }
-
-            return -1;
-        }
-
-        /// <summary>
-        /// Saves the current highscore to a text file. 
-        /// </summary>
-        public static void SaveHighscore()
-        {
-            // Get the place to store data
-            using (IsolatedStorageFile isf = 
-                IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // Create a file to save the highscore data
-                
-                /*using (IsolatedStorageFileStream isfs = 
-                    isf.CreateFile("highscores.txt"))
-                {
-                    using (StreamWriter writer = new StreamWriter(isfs))
-                    {
-                        for (int i = 0; i < highScore.Count; i++)
-                        {
-                            // Write the scores
-                            writer.WriteLine(highScore[i].Key);
-                            writer.WriteLine(highScore[i].Value.ToString());
-                        }
-                    }
-                }*/
-            }
-        }
-
-        /// <summary>
-        /// Loads the high scores from a text file.  
-        /// </summary>
-        public static void LoadHighscores()
-        {
-            // Get the place where data is stored
-            /*using (IsolatedStorageFile isf = 
-                IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // Try to open the file
-                if (isf.FileExists("highscores.txt"))
-                {
-                    using (IsolatedStorageFileStream isfs = 
-                        isf.OpenFile("highscores.txt", FileMode.Open))                        
-                    {
-                        // Get the stream to read the data
-                        using (StreamReader reader = new StreamReader(isfs))
-                        {
-                            // Read the highscores
-                            int i = 0;
-                            while (!reader.EndOfStream)
-                            {
-                                string name = reader.ReadLine();
-                                int score = int.Parse(reader.ReadLine());
-
-                                highScore[i++] =  new KeyValuePair<string, int>(
-                                    name, score);
-                            }
-                        }
-                    }
-                }
-            }
-
-            OrderGameScore();
-            */
-        }
-
-        #endregion
-    }
-}

+ 0 - 196
StarterKits/iOS/MemoryMadness/Screens/LoadingAndInstructionsScreen.cs

@@ -1,196 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// LoadingAndInstructionScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-using System.Threading;
-using Microsoft.Xna.Framework.Input.Touch;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class LoadingAndInstructionsScreen : GameScreen
-    {
-        #region Fields
-
-        Texture2D background;
-        SpriteFont font;
-        bool isLoading;
-        GameplayScreen gameplayScreen;
-        Thread thread;
-
-        int levelNumber;
-        int movesPerformed;
-
-        bool isResuming;
-
-        #endregion
-
-        #region Initialization
-
-        public LoadingAndInstructionsScreen(bool isResuming)
-        {
-            levelNumber = 1;
-            movesPerformed = 0;
-
-            TransitionOnTime = TimeSpan.FromSeconds(0);
-            TransitionOffTime = TimeSpan.FromSeconds(0.5);
-
-            EnabledGestures = GestureType.Tap;
-
-            // Initialize the current level and number of moves already performed
-            // according to the game state information
-            if (PhoneApplicationService.Current.State.ContainsKey("CurrentLevel"))
-            {
-                this.levelNumber = 
-                    (int)PhoneApplicationService.Current.State["CurrentLevel"];
-                PhoneApplicationService.Current.State.Remove("CurrentLevel");
-            }
-
-            if (PhoneApplicationService.Current.State.ContainsKey("MovesPerformed"))
-            {
-                this.movesPerformed = 
-                    (int)PhoneApplicationService.Current.State["MovesPerformed"];
-                PhoneApplicationService.Current.State.Remove("MovesPerformed");
-            }
-
-            this.isResuming = isResuming;
-        }
-
-        #endregion
-
-        #region Loading
-
-        /// <summary>
-        /// Load the screen resources
-        /// </summary>
-        public override void LoadContent()
-        {
-            if (!isResuming)
-            {
-                background = Load<Texture2D>(@"Textures\Backgrounds\Instructions");
-            }
-            else
-            {
-                background = Load<Texture2D>(@"Textures\Backgrounds\Resuming");
-            }
-            font = Load<SpriteFont>(@"Fonts\MenuFont");
-
-            // Create a new instance of the gameplay screen
-            gameplayScreen = new GameplayScreen(levelNumber, movesPerformed);
-            gameplayScreen.ScreenManager = ScreenManager;
-        }
-
-        #endregion
-
-        #region Update
-
-        /// <summary>
-        /// Exit the screen after a tap gesture.
-        /// </summary>
-        /// <param name="input"></param>
-        public override void HandleInput(InputState input)
-        {
-            if (!isLoading)
-            {
-                if (input.Gestures.Count > 0)
-                {
-                    if (input.Gestures[0].GestureType == GestureType.Tap)
-                    {
-                        // Start loading the gameplay resources in an additional thread
-                        thread = new Thread(
-                            new ThreadStart(gameplayScreen.LoadAssets));
-
-                        isLoading = true;
-                        thread.Start();
-                    }
-                }
-            }
-            base.HandleInput(input);
-        }
-
-        /// <summary>
-        /// Screen update logic.
-        /// </summary>
-        /// <param name="gameTime"></param>
-        /// <param name="otherScreenHasFocus"></param>
-        /// <param name="coveredByOtherScreen"></param>
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
-        {
-            // If the additional thread is running, wait for it to finish
-            if (null != thread)
-            {
-                // If the additional thread finished loading and the screen is not 
-                // exiting, exit it
-                if (thread.ThreadState == ThreadState.Stopped && !IsExiting)
-                {
-                    // Move on to the gameplay screen
-                    foreach (GameScreen screen in ScreenManager.GetScreens())
-                        screen.ExitScreen();
-
-                    gameplayScreen.IsActive = true;
-                    ScreenManager.AddScreen(gameplayScreen, null);
-                }
-            }
-            // if resuming, don't wait for the user to launch the loading thread
-            else if (isResuming)
-            {
-                thread = new Thread(
-                            new ThreadStart(gameplayScreen.LoadAssets));
-
-                isLoading = true;
-                thread.Start();
-            }
-
-            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-        }
-
-        #endregion
-
-        #region Render
-
-        /// <summary>
-        /// Render screen 
-        /// </summary>
-        /// <param name="gameTime"></param>
-        public override void Draw(GameTime gameTime)
-        {
-            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-
-            spriteBatch.Begin();
-
-            // Draw Background
-            spriteBatch.Draw(background, new Vector2(0, 0),
-                 Color.White * TransitionAlpha);
-
-            // If loading gameplay screen resource in the 
-            // background show "Loading..." text
-            if (isLoading && !isResuming)
-            {
-                string text = "Loading...";
-                Vector2 size = font.MeasureString(text);
-                Vector2 position = new Vector2(
-                    (ScreenManager.GraphicsDevice.Viewport.Width - size.X) / 2,
-                    (ScreenManager.GraphicsDevice.Viewport.Height - size.Y) / 2);
-                spriteBatch.DrawString(font, text, position, Color.White);
-            }
-
-            spriteBatch.End();
-        }
-
-        #endregion
-    }
-}

+ 0 - 100
StarterKits/iOS/MemoryMadness/Screens/MainMenuScreen.cs

@@ -1,100 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// MainMenuScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class MainMenuScreen : MenuScreen
-    {
-        #region Initializations
-
-        public MainMenuScreen()
-            : base("")
-        {
-            // Create our menu entries.
-            MenuEntry startGameMenuEntry = new MenuEntry("Start");
-            MenuEntry highScoreMenuEntry = new MenuEntry("High scores");
-            MenuEntry exitMenuEntry = new MenuEntry("Exit");
-
-            // Hook up menu event handlers.
-            startGameMenuEntry.Selected += StartGameMenuEntrySelected;
-            highScoreMenuEntry.Selected += HighScoreMenuEntrySelected;
-            exitMenuEntry.Selected += OnCancel;
-
-            // Add entries to the menu.
-            MenuEntries.Add(startGameMenuEntry);
-            MenuEntries.Add(highScoreMenuEntry);
-            MenuEntries.Add(exitMenuEntry);
-        }
-
-        #endregion
-
-        #region Update
-
-        /// <summary>
-        /// Respond to "High Score" Item Selection
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void HighScoreMenuEntrySelected(object sender, EventArgs e)
-        {
-            foreach (GameScreen screen in ScreenManager.GetScreens())
-                screen.ExitScreen();
-
-            ScreenManager.AddScreen(new BackgroundScreen(true), null);
-            ScreenManager.AddScreen(new HighScoreScreen(), null);
-        }
-
-        /// <summary>
-        /// Respond to "Play" Item Selection
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void StartGameMenuEntrySelected(object sender, EventArgs e)
-        {
-            foreach (GameScreen screen in ScreenManager.GetScreens())
-                screen.ExitScreen();
-
-            // if a saved game exists, let the user decide whether or not to use it
-            // by moving to a sub-menu
-            if (PhoneApplicationService.Current.State.ContainsKey("CurrentLevel") &&
-                (int)PhoneApplicationService.Current.State["CurrentLevel"] > 1)
-            {
-                ScreenManager.AddScreen(new BackgroundScreen(false), null);
-                ScreenManager.AddScreen(new NewGameSubMenuScreen(), null);
-            }
-            else
-            {
-                ScreenManager.AddScreen(new LoadingAndInstructionsScreen(false), null);
-            }
-        }
-
-        /// <summary>
-        /// Respond to "Exit" Item Selection
-        /// </summary>
-        /// <param name="playerIndex"></param>
-        protected override void OnCancel(PlayerIndex playerIndex)
-        {
-            HighScoreScreen.SaveHighscore();
-
-            ScreenManager.Game.Exit();
-        }
-
-        #endregion
-    }
-}

+ 0 - 89
StarterKits/iOS/MemoryMadness/Screens/NewGameSubMenu.cs

@@ -1,89 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// MainMenuScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class NewGameSubMenuScreen : MenuScreen
-    {
-        #region Initializations
-
-        public NewGameSubMenuScreen()
-            : base("")
-        {
-            // Create our menu entries.
-            MenuEntry newGameMenuEntry = new MenuEntry("New Game");
-            MenuEntry loadGameMenuEntry = new MenuEntry("Load");
-
-            // Hook up menu event handlers.
-            newGameMenuEntry.Selected += NewGameMenuEntrySelected;
-            loadGameMenuEntry.Selected += LoadGameMenuEntrySelected;
-
-            // Add entries to the menu.
-            MenuEntries.Add(newGameMenuEntry);
-            MenuEntries.Add(loadGameMenuEntry);
-        }
-
-        #endregion
-
-        #region Update
-
-        /// <summary>
-        /// Respond to "Load Game" Item Selection
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void LoadGameMenuEntrySelected(object sender, EventArgs e)
-        {
-            foreach (GameScreen screen in ScreenManager.GetScreens())
-                screen.ExitScreen();
-
-            ScreenManager.AddScreen(new LoadingAndInstructionsScreen(false), null);
-        }
-
-        /// <summary>
-        /// Respond to "New Game" Item Selection
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void NewGameMenuEntrySelected(object sender, EventArgs e)
-        {
-            if (PhoneApplicationService.Current.State.ContainsKey("CurrentLevel"))
-            {                
-                PhoneApplicationService.Current.State.Remove("CurrentLevel");
-            }
-
-            LoadGameMenuEntrySelected(sender, e);
-        }
-
-        /// <summary>
-        /// Handle the back button and return to the main menu.
-        /// </summary>
-        /// <param name="playerIndex"></param>
-        protected override void OnCancel(PlayerIndex playerIndex)
-        {
-            foreach (GameScreen screen in ScreenManager.GetScreens())
-                screen.ExitScreen();
-
-            ScreenManager.AddScreen(new BackgroundScreen(false), null);
-            ScreenManager.AddScreen(new MainMenuScreen(), null);            
-        }
-
-        #endregion
-    }
-}

+ 0 - 257
StarterKits/iOS/MemoryMadness/Screens/PauseScreen.cs

@@ -1,257 +0,0 @@
-#region File Description
-
-//-----------------------------------------------------------------------------
-// PauseScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-
-#endregion
-
-#region Using Statements
-
-using System;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-using Microsoft.Xna.Framework.GamerServices;
-
-#endregion
-
-namespace MemoryMadness
-{
-    class PauseScreen : MenuScreen
-    {
-        #region Fields
-
-        bool isResuming;
-        bool checkHighscore = false;
-        bool moveToHighScore = false;
-        bool moveToMainMenu = false;
-
-        #endregion
-
-        #region Initializations
-
-        /// <summary>
-        /// Creates a new instance of the pause screen.
-        /// </summary>
-        /// <param name="isResuming">Whether or not the screen is displayed as a
-        /// response to resuming the game (returning to it after the win key has
-        /// been pressed, for example).</param>
-        public PauseScreen(bool isResuming)
-            : base("Pause")
-        {
-            // Create our menu entries
-            MenuEntry returnGameMenuEntry = new MenuEntry("Return");
-            MenuEntry exitMenuEntry = new MenuEntry("Quit");
-
-            // Hook up menu event handlers
-            returnGameMenuEntry.Selected += ReturnGameMenuEntrySelected;
-            exitMenuEntry.Selected += OnCancel;
-
-            // Add entries to the menu
-            MenuEntries.Add(returnGameMenuEntry);
-            MenuEntries.Add(exitMenuEntry);
-
-            this.isResuming = isResuming;
-
-            if (!isResuming)
-                AudioManager.PauseResumeSounds(false);
-        }
-
-        #endregion
-
-        #region Loading
-
-        /// <summary>
-        /// Load screen resources
-        /// </summary>
-        public override void LoadContent()
-        {
-            if (isResuming && !AudioManager.IsInitialized)
-                AudioManager.LoadSounds();
-
-            AudioManager.PlaySound("menu");
-            base.LoadContent();
-        }
-
-        #endregion
-
-        #region Update
-
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
-        {
-            if (checkHighscore && (!Guide.IsVisible)) 
-            {
-                checkHighscore = false;
-
-                var gameplayScreen = GetGameplayScreen();
-
-                var levelNumber = gameplayScreen.currentLevel.levelNumber;
-
-                if (HighScoreScreen.IsInHighscores(levelNumber))
-                {
-                    // Show the device's keyboard to record a high score
-                    Guide.BeginShowKeyboardInput(PlayerIndex.One,
-                        Constants.HighscorePopupTitle, Constants.HighscorePopupText,
-                        Constants.HighscorePopupDefault, ShowHighscorePromptEnded,
-                        levelNumber);                        
-                }
-                else
-                {
-                    moveToMainMenu = true;
-                }
-            }
-            else if (moveToHighScore)
-            {
-                foreach (GameScreen screen in ScreenManager.GetScreens())
-                    screen.ExitScreen();
-
-                ScreenManager.AddScreen(new BackgroundScreen(true), null);
-                ScreenManager.AddScreen(new HighScoreScreen(), null);
-            }
-            else if (moveToMainMenu)
-            {
-                foreach (GameScreen screen in ScreenManager.GetScreens())
-                    screen.ExitScreen();
-
-                ScreenManager.AddScreen(new BackgroundScreen(false), null);
-                ScreenManager.AddScreen(new MainMenuScreen(), null);
-            }
-
-            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-        }
-
-        /// <summary>
-        /// Asynchronous handler for the highscore player name popup messagebox.
-        /// </summary>
-        /// <param name="result">The popup messagebox result. The result's
-        /// AsyncState should contain the level number which acts as the
-        /// highscore.</param>
-        private void ShowHighscorePromptEnded(IAsyncResult result)
-        {
-            string playerName = Guide.EndShowKeyboardInput(result);            
-
-            int levelNumber = (int)result.AsyncState;
-
-            if (playerName != null)
-            {
-                if (playerName.Length > 15)
-                    playerName = playerName.Substring(0, 15);
-
-                HighScoreScreen.PutHighScore(playerName, levelNumber);
-            }
-
-            moveToHighScore = true;            
-        }
-
-        /// <summary>
-        /// Respond to "Return" Item Selection
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        void ReturnGameMenuEntrySelected(object sender, EventArgs e)
-        {
-            if (!isResuming)
-            {
-                // Resume sounds and activate the gameplay screen
-                AudioManager.PauseResumeSounds(true);
-
-                var screens = ScreenManager.GetScreens();
-
-                foreach (GameScreen screen in screens)
-                {
-                    if (!(screen is GameplayScreen))
-                    {
-                        screen.ExitScreen();
-                    }
-                }
-
-                (ScreenManager.GetScreens()[0] as GameplayScreen).IsActive = true;
-            }
-            else
-            {
-                // Since we are resuming the game, go to the loading screen which will
-                // in turn initialize the gameplay screen
-                foreach (GameScreen screen in ScreenManager.GetScreens())
-                    screen.ExitScreen();
-
-                ScreenManager.AddScreen(new LoadingAndInstructionsScreen(true), null);
-            }
-        }
-
-        /// <summary>
-        /// Respond to "Quit Game" Item Selection
-        /// </summary>
-        /// <param name="playerIndex"></param>
-        protected override void OnCancel(PlayerIndex playerIndex)
-        {
-            AudioManager.StopSounds();
-
-            // Give the user a chance to save his current progress
-            Guide.BeginShowMessageBox("Save Game", "Do you want to save your progress?",
-                new String[] { "Yes", "No" }, 0, MessageBoxIcon.Warning,
-                ShowSaveDialogEnded, null);
-        }
-
-        /// <summary>
-        /// Asynchronous handler for the game save popup messagebox.
-        /// </summary>
-        /// <param name="result">The popup messagebox result.</param>
-        private void ShowSaveDialogEnded(IAsyncResult result)
-        {
-            int? res = Guide.EndShowMessageBox(result);
-
-            if (res.HasValue)
-            {
-                // Store the user's progress
-                if (res.Value == 0)
-                {
-                    if (!PhoneApplicationService.Current.State.ContainsKey(
-                        "CurrentLevel"))
-                    {
-                        var gameplayScreen = GetGameplayScreen();
-
-                        PhoneApplicationService.Current.State["CurrentLevel"]
-                            = gameplayScreen.currentLevel.levelNumber;
-                    }
-
-                    foreach (GameScreen screen in ScreenManager.GetScreens())
-                        screen.ExitScreen();
-
-                    ScreenManager.AddScreen(new BackgroundScreen(false),
-                        null);
-                    ScreenManager.AddScreen(new MainMenuScreen(), null);
-                }
-                // The user really quit the game, see if he has a high score
-                else
-                {
-                    checkHighscore = true;
-                }
-            }                        
-        }
-
-        #endregion
-
-        /// <summary>
-        /// Finds a gameplay screen objects among all screens and returns it.
-        /// </summary>
-        /// <returns>A gameplay screen instance, or null if none 
-        /// are available.</returns>
-        private GameplayScreen GetGameplayScreen()
-        {
-            var screens = ScreenManager.GetScreens();
-
-            foreach (var screen in screens)
-            {
-                if (screen is GameplayScreen)
-                {
-                    return screen as GameplayScreen;
-                }
-            }
-
-            return null;
-        }
-    }
-}

BIN
StarterKits/iOS/MemoryMadness/xnatouchicon.png


+ 3 - 32
StarterKits/iOS/Platformer/Platformer.csproj

@@ -8,7 +8,6 @@
     <OutputType>Exe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Platformer</RootNamespace>
-    <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
     <ProductVersion>9.0.21022</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <StartupObject>Platformer.Program</StartupObject>
@@ -22,14 +21,10 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <MtouchLink>None</MtouchLink>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
     <AssemblyName>Platformer</AssemblyName>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
     <DebugType>none</DebugType>
@@ -38,14 +33,9 @@
     <DefineConstants>TRACE;IPHONE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
     <MtouchI18n />
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
     <AssemblyName>Platformer</AssemblyName>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
     <DebugSymbols>true</DebugSymbols>
@@ -55,16 +45,12 @@
     <DefineConstants>DEBUG;TRACE;IPHONE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>True</MtouchDebug>
+    <MtouchDebug>true</MtouchDebug>
     <MtouchI18n />
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
     <AssemblyName>Platformer</AssemblyName>
     <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
     <DebugType>none</DebugType>
@@ -73,42 +59,27 @@
     <DefineConstants>TRACE;IPHONE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
     <MtouchI18n />
     <CodesignKey>iPhone Developer</CodesignKey>
     <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchUseThumb>false</MtouchUseThumb>
-    <MtouchUseSGen>false</MtouchUseSGen>
     <AssemblyName>Platformer</AssemblyName>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug</OutputPath>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <AssemblyName>PlatformeriPhone</AssemblyName>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Release</OutputPath>
     <WarningLevel>4</WarningLevel>
-    <MtouchDebug>False</MtouchDebug>
-    <MtouchUseSGen>false</MtouchUseSGen>
-    <MtouchUseLlvm>false</MtouchUseLlvm>
     <AssemblyName>PlatformeriPhone</AssemblyName>
-    <MtouchUseThumb>false</MtouchUseThumb>
     <MtouchUseArmv7>false</MtouchUseArmv7>
-    <MtouchArch>ARMv6</MtouchArch>
   </PropertyGroup>
   <ItemGroup>
     <Folder Include="Properties\" />
@@ -147,4 +118,4 @@
   </Target>
   <Target Name="AfterBuild">
   </Target>
-  --><ItemGroup><ProjectReference Include="..\..\..\MonoGame.Framework\MonoGame.Framework.iOS.csproj"><Project>{DB8508BB-9849-4CC2-BC0F-8EB5DACB3C47}</Project><Name>MonoGame.Framework.iOS</Name></ProjectReference></ItemGroup></Project>
+  --><ItemGroup><ProjectReference Include="..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.iOS.csproj"><Project>{DB8508BB-9849-4CC2-BC0F-8EB5DACB3C47}</Project><Name>MonoGame.Framework.iOS</Name></ProjectReference></ItemGroup></Project>

+ 5 - 3
StarterKits/iOS/Platformer/Program.cs

@@ -20,13 +20,15 @@ namespace Platformer
 {
 	#if IPHONE
 	[Register ("AppDelegate")]
-	class  Program : MonoGameProgram
+	class  Program : UIApplicationDelegate
 	{
+		private PlatformerGame game;
+		
 		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
 		{
 			// Fun begins..
-			MonoGameGame = new PlatformerGame(); 
-            MonoGameGame.Run();
+			game = new PlatformerGame(); 
+            game.Run();
 			
 			return true;
 		}

+ 4 - 7
StarterKits/iOS/VectorRumble/Program.cs

@@ -23,16 +23,13 @@ namespace VectorRumble
 	[Register ("AppDelegate")]
 	class Program : UIApplicationDelegate 
 	{
+		private VectorRumbleGame game;
+		
 		public override void FinishedLaunching (UIApplication app)
 		{
 			// Fun begins..
-			using (VectorRumbleGame game = new VectorRumbleGame())
-            {
-                game.Run();
-            }
-			
-			//MediaLibrary lib = new MediaLibrary();
-			//object result = lib.Playlists;
+			game= new VectorRumbleGame();
+            game.Run();
 		}
 
 		static void Main (string [] args)