Commits

André Schnabel  committed 9ff0905 Draft

WP7 Tweaks

  • Participants
  • Parent commits d74af6f

Comments (0)

Files changed (5)

File XNAPlayground/XNAPlayground/Background.png

Old
Old image
New
New image

File XNAPlayground/XNAPlayground/Map/GameMap.cs

 		public static void LoadMapInfos() {
 			MapInfo[] infos = MapInfos;
 
-#if IOS
+#if IOS || WINDOWS_PHONE
 			var store = IsolatedStorageFile.GetUserStoreForApplication();
 #endif
 
 			}
 
 			int counter = 0;
-#if IOS
+#if IOS || WINDOWS_PHONE
 			if(store.FileExists(SaveFilename)) {
 				var strm = new IsolatedStorageFileStream(SaveFilename, FileMode.Open, store);
 				var reader = new StreamReader(strm);
 				string fstr = reader.ReadToEnd();
 #else
-			if(File.Exists(SaveFilename)) {
+			if (File.Exists(SaveFilename)) {
 				string fstr = File.ReadAllText(SaveFilename);
 #endif
 
 					counter++;
 				}
 
-#if IOS
+#if IOS || WINDOWS_PHONE
 				reader.Dispose();
 				strm.Dispose();
 			}
 
 		}
 
-		public static void SaveMapInfos() {
-#if IOS
+		public static void SaveMapInfos()
+		{
+#if IOS || WINDOWS_PHONE
 			var store = IsolatedStorageFile.GetUserStoreForApplication();
 			var strm = new IsolatedStorageFileStream(SaveFilename, FileMode.Create, store);
 			var writer = new StreamWriter(strm);
 				mapInfoStr += info.TicksNeeded;
 				mapInfoStr += "\n";
 			}
-#if IOS
+#if IOS || WINDOWS_PHONE
 			writer.Write(mapInfoStr);
 			writer.Dispose();
 			strm.Dispose();

File XNAPlayground/XNAPlayground/PhoneGameThumb.png

Old
Old image
New
New image

File XNAPlayground/XNAPlayground/Screens/SplashScreen.cs

 
 		#region Implementation of IScreen
 		public override void Update() {
+			if(GamePad.GetState(0).IsButtonDown(Buttons.Back))
+				Game.Exit();
+
 #if WINDOWS_PHONE || IOS
 			TouchCollection touchCollection = TouchPanel.GetState();
 

File XNAPlayground/XNAPlayground/Screens/WorldScreen.cs

 		private const long StepFreq = 150;
 
 		private void ProcessInput() {
+			if(GamePad.GetState(0).IsButtonDown(Buttons.Back)) {
+				Game.SetScreen(new SplashScreen(Game));
+			}
+
 #if WINDOWS_PHONE || IOS
 			TouchCollection touchCollection = TouchPanel.GetState();
 			if(!mouseWasReleased && touchCollection.Count == 0) mouseWasReleased = true;