瀏覽代碼

[CatapultNetWars & NetworkStateManagement] Changes to support better scaled rendering.

Dominique Louis 3 周之前
父節點
當前提交
90d8e27c3f
共有 28 個文件被更改,包括 77 次插入87 次删除
  1. 0 3
      CatapultNetWars/Core/CatapultGame.cs
  2. 1 1
      CatapultNetWars/Core/MessageDisplayComponent.cs
  3. 1 2
      CatapultNetWars/Core/Networking/NetworkBusyScreen.cs
  4. 0 14
      CatapultNetWars/Core/ScreenManager/MenuEntry.cs
  5. 9 9
      CatapultNetWars/Core/ScreenManager/MenuScreen.cs
  6. 1 3
      CatapultNetWars/Core/ScreenManager/ScreenManager.cs
  7. 9 9
      CatapultNetWars/Core/Screens/GameplayScreen.cs
  8. 1 2
      CatapultNetWars/Core/Screens/LoadingScreen.cs
  9. 1 2
      CatapultNetWars/Core/Screens/MessageBoxScreen.cs
  10. 1 1
      CatapultNetWars/Platforms/Android/AndroidManifest.xml
  11. 1 1
      CatapultNetWars/Platforms/Android/MainActivity.cs
  12. 1 1
      CatapultNetWars/Platforms/Desktop/Program.cs
  13. 1 1
      CatapultNetWars/Platforms/Windows/Program.cs
  14. 7 0
      CatapultNetWars/Platforms/iOS/Info.plist
  15. 14 5
      CatapultNetWars/Platforms/iOS/Program.cs
  16. 1 1
      NetworkStateManagement/Core/MessageDisplayComponent.cs
  17. 1 2
      NetworkStateManagement/Core/Networking/NetworkBusyScreen.cs
  18. 1 3
      NetworkStateManagement/Core/ScreenManager/ScreenManager.cs
  19. 1 2
      NetworkStateManagement/Core/Screens/BackgroundScreen.cs
  20. 1 2
      NetworkStateManagement/Core/Screens/LoadingScreen.cs
  21. 0 14
      NetworkStateManagement/Core/Screens/MenuEntry.cs
  22. 2 2
      NetworkStateManagement/Core/Screens/MenuScreen.cs
  23. 1 2
      NetworkStateManagement/Core/Screens/MessageBoxScreen.cs
  24. 1 1
      NetworkStateManagement/Platforms/Android/AndroidManifest.xml
  25. 1 1
      NetworkStateManagement/Platforms/Android/MainActivity.cs
  26. 0 0
      NetworkStateManagement/Platforms/Android/Program.cs
  27. 7 0
      NetworkStateManagement/Platforms/iOS/Info.plist
  28. 12 3
      NetworkStateManagement/Platforms/iOS/Program.cs

+ 0 - 3
CatapultNetWars/Core/CatapultGame.cs

@@ -66,9 +66,6 @@ namespace CatapultGame
 
 			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);

+ 1 - 1
CatapultNetWars/Core/MessageDisplayComponent.cs

@@ -120,7 +120,7 @@ namespace CatapultGame
                 if (messages.Count == 0)
                     return;
 
-                Vector2 position = new Vector2(GraphicsDevice.Viewport.Width - 100, 0);
+                Vector2 position = new Vector2(ScreenManager.BASE_BUFFER_WIDTH - 100, 0);
 
                 spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, game.ScreenManager.GlobalTransformation);
 

+ 1 - 2
CatapultNetWars/Core/Networking/NetworkBusyScreen.cs

@@ -140,8 +140,7 @@ namespace CatapultGame
 			const int vPad = 16;
 
 			// Center the message text in the viewport.
-			Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-			Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
+			Vector2 viewportSize = new Vector2(ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
 			Vector2 textSize = font.MeasureString(message);
 
 			// Add enough room to spin a cat.

+ 0 - 14
CatapultNetWars/Core/ScreenManager/MenuEntry.cs

@@ -89,13 +89,6 @@ namespace CatapultGame
         /// </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 (UIUtility.IsMobile)
-            {
-                isSelected = false;
-            }
-
             // When the menu selection changes, entries gradually fade between
             // their selected and deselected appearance, rather than instantly
             // popping to the new state.
@@ -113,13 +106,6 @@ namespace CatapultGame
         /// </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
-            if (UIUtility.IsMobile)
-            {
-                isSelected = false;
-            }
-
             // Draw the selected entry in yellow, otherwise white.
             Color color = isSelected ? Color.Yellow : Color.White;
 

+ 9 - 9
CatapultNetWars/Core/ScreenManager/MenuScreen.cs

@@ -61,7 +61,7 @@ namespace CatapultGame
             return new Rectangle(
                 0,
                 (int)entry.Position.Y - menuEntryPadding,
-                ScreenManager.GraphicsDevice.Viewport.Width,
+                ScreenManager.BASE_BUFFER_WIDTH,
                 entry.GetHeight(this) + (menuEntryPadding * 2));
         }
 
@@ -106,9 +106,9 @@ namespace CatapultGame
 
                     if (GetMenuEntryHitBounds(menuEntry).Contains(clickLocation))
                     {
-                        // select the entry. since gestures are only available on Windows Phone,
+                        // select the entry. since gestures are only available on Mobiles,
                         // we can safely pass PlayerIndex.One to all entries since there is only
-                        // one player on Windows Phone.
+                        // one player on Mobiles.
                         OnSelectEntry(i, PlayerIndex.One);
                     }
                 }
@@ -125,9 +125,9 @@ namespace CatapultGame
 
                     if (GetMenuEntryHitBounds(menuEntry).Contains(clickLocation))
                     {
-                        // select the entry. since gestures are only available on Windows Phone,
+                        // select the entry. since gestures are only available on Mobiles,
                         // we can safely pass PlayerIndex.One to all entries since there is only
-                        // one player on Windows Phone.
+                        // one player on Mobiles.
                         //OnSelectEntry(i, PlayerIndex.One);
                         selectedEntry = i;
                     }
@@ -149,9 +149,9 @@ namespace CatapultGame
 
                         if (GetMenuEntryHitBounds(menuEntry).Contains(tapLocation))
                         {
-                            // select the entry. since gestures are only available on Windows Phone,
+                            // select the entry. since gestures are only available on Mobiles,
                             // we can safely pass PlayerIndex.One to all entries since there is only
-                            // one player on Windows Phone.
+                            // one player on Mobiles.
                             OnSelectEntry(i, PlayerIndex.One);
                         }
                     }
@@ -203,7 +203,7 @@ namespace CatapultGame
                 MenuEntry menuEntry = menuEntries[i];
 
                 // each entry is to be centered horizontally
-                position.X = ScreenManager.GraphicsDevice.Viewport.Width / 2 - menuEntry.GetWidth(this) / 2;
+                position.X = ScreenManager.BASE_BUFFER_WIDTH / 2 - menuEntry.GetWidth(this) / 2;
 
                 if (ScreenState == ScreenState.TransitionOn)
                     position.X -= transitionOffset * 256;
@@ -279,7 +279,7 @@ namespace CatapultGame
             float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
 
             // Draw the menu title centered on the screen
-            Vector2 titlePosition = new Vector2(graphics.Viewport.Width / 2, 80);
+            Vector2 titlePosition = new Vector2(ScreenManager.BASE_BUFFER_WIDTH / 2, 80);
             Vector2 titleOrigin = font.MeasureString(menuTitle) / 2;
             Color titleColor = new Color(192, 192, 192) * TransitionAlpha;
             float titleScale = 1.25f;

+ 1 - 3
CatapultNetWars/Core/ScreenManager/ScreenManager.cs

@@ -283,12 +283,10 @@ namespace CatapultGame
         /// </summary>
         public void FadeBackBufferToBlack(float alpha)
         {
-            Viewport viewport = GraphicsDevice.Viewport;
-
             spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, GlobalTransformation);
 
             spriteBatch.Draw(blankTexture,
-                             new Rectangle(0, 0, viewport.Width, viewport.Height),
+                             new Rectangle(0, 0, BASE_BUFFER_WIDTH, BASE_BUFFER_HEIGHT),
                              Color.Black * alpha);
 
             spriteBatch.End();

+ 9 - 9
CatapultNetWars/Core/Screens/GameplayScreen.cs

@@ -558,17 +558,17 @@ namespace CatapultGame
 
 			cloud1Position += new Vector2(24.0f, 0.0f) * elapsedTime *
 				windDirection * wind.Y;
-			if (cloud1Position.X > ScreenManager.GraphicsDevice.Viewport.Width)
+			if (cloud1Position.X > ScreenManager.BASE_BUFFER_WIDTH)
 				cloud1Position.X = -cloud1Texture.Width * 2.0f;
 			else if (cloud1Position.X < -cloud1Texture.Width * 2.0f)
-				cloud1Position.X = ScreenManager.GraphicsDevice.Viewport.Width;
+				cloud1Position.X = ScreenManager.BASE_BUFFER_WIDTH;
 
 			cloud2Position += new Vector2(16.0f, 0.0f) * elapsedTime *
 				windDirection * wind.Y;
-			if (cloud2Position.X > ScreenManager.GraphicsDevice.Viewport.Width)
+			if (cloud2Position.X > ScreenManager.BASE_BUFFER_WIDTH)
 				cloud2Position.X = -cloud2Texture.Width * 2.0f;
 			else if (cloud2Position.X < -cloud2Texture.Width * 2.0f)
-				cloud2Position.X = ScreenManager.GraphicsDevice.Viewport.Width;
+				cloud2Position.X = ScreenManager.BASE_BUFFER_WIDTH;
 		}
 
 		/// <summary>
@@ -595,7 +595,7 @@ namespace CatapultGame
 		private void DrawBackground()
 		{
 			// Clear the background
-			ScreenManager.Game.GraphicsDevice.Clear(Color.White);
+			ScreenManager.Game.GraphicsDevice.Clear(Color.Black);
 
 			// Draw the Sky
 			ScreenManager.SpriteBatch.Draw(skyTexture, Vector2.Zero, Color.White);
@@ -673,8 +673,8 @@ namespace CatapultGame
 				}
 
 				ScreenManager.SpriteBatch.Draw(texture,
-												new Vector2(ScreenManager.Game.GraphicsDevice.Viewport.Width / 2 - texture.Width / 2,
-							 ScreenManager.Game.GraphicsDevice.Viewport.Height / 2 - texture.Height / 2),
+												new Vector2(ScreenManager.BASE_BUFFER_WIDTH / 2 - texture.Width / 2,
+							 ScreenManager.BASE_BUFFER_HEIGHT / 2 - texture.Height / 2),
 												Color.White);
 			}
 			else
@@ -749,8 +749,8 @@ namespace CatapultGame
 				size = hudFont.MeasureString(text);
 
 				DrawString(hudFont, text,
-							new Vector2(ScreenManager.GraphicsDevice.Viewport.Width / 2 - size.X / 2,
-							 ScreenManager.GraphicsDevice.Viewport.Height - size.Y),
+							new Vector2(ScreenManager.BASE_BUFFER_WIDTH / 2 - size.X / 2,
+							 ScreenManager.BASE_BUFFER_HEIGHT - size.Y),
 							Color.Green);
 			}
 		}

+ 1 - 2
CatapultNetWars/Core/Screens/LoadingScreen.cs

@@ -177,8 +177,7 @@ namespace CatapultGame
 				string message = Resources.Loading;
 
 				// Center the text in the viewport.
-				Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-				Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
+				Vector2 viewportSize = new Vector2(ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
 				Vector2 textSize = font.MeasureString(message);
 				Vector2 textPosition = (viewportSize - textSize) / 2;
 

+ 1 - 2
CatapultNetWars/Core/Screens/MessageBoxScreen.cs

@@ -120,8 +120,7 @@ namespace CatapultGame
             ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 2 / 3);
 
             // Center the message text in the viewport.
-            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-            Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
+            Vector2 viewportSize = new Vector2(ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
             Vector2 textSize = font.MeasureString(message);
             Vector2 textPosition = (viewportSize - textSize) / 2;
 

+ 1 - 1
CatapultNetWars/Platforms/Android/AndroidManifest.xml

@@ -4,6 +4,6 @@
 	<uses-feature android:glEsVersion="0x00020000" android:required="true" />
 	<application android:label="@string/app_name" android:icon="@drawable/icon"></application>
 	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-	<uses-permission android:name="android.permission.GET_ACCOUNTS" />
 	<uses-permission android:name="android.permission.INTERNET" />
+	<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
 </manifest>

+ 1 - 1
CatapultNetWars/Platforms/Android/MainActivity.cs

@@ -9,7 +9,7 @@ using Android.OS;
 using Microsoft.Xna.Framework;
 using Android.Content.PM;
 
-namespace CatapultGame
+namespace CatapultGame.Android
 {
     [Activity(
         Label = "@string/app_name",

+ 1 - 1
CatapultNetWars/Platforms/Desktop/Program.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace CatapultGame
+namespace CatapultGame.DesktopGL
 {
     public static class Program
     {

+ 1 - 1
CatapultNetWars/Platforms/Windows/Program.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace CatapultGame
+namespace CatapultGame.Windows
 {
     public static class Program
     {

+ 7 - 0
CatapultNetWars/Platforms/iOS/Info.plist

@@ -12,5 +12,12 @@
 	<string>10.6</string>
 	<key>NSPrincipalClass</key>
 	<string>NSApplication</string>
+	<key>UISupportedInterfaceOrientations</key>
+    <array>
+        <string>UIInterfaceOrientationLandscapeLeft</string>
+        <string>UIInterfaceOrientationLandscapeRight</string>
+    </array>
+	<key>NSLocalNetworkUsageDescription</key>
+	<string>This app requires access to the local network to find and join multiplayer games.</string>
 </dict>
 </plist>

+ 14 - 5
CatapultNetWars/Platforms/iOS/Program.cs

@@ -1,13 +1,22 @@
+using Foundation;
 using UIKit;
 
-namespace CatapultGame
+namespace CatapultGame.iOS
 {
-    public class Application
+    [Register("AppDelegate")]
+    class AppDelegate : UIApplicationDelegate
     {
-        // This is the main entry point of the application.
+        private CatapultGame game;
+
+        public override void FinishedLaunching(UIApplication app)
+        {
+            game = new CatapultGame();
+            game.Run();
+        }
+
         static void Main(string[] args)
         {
-            UIApplication.Main(args, null, "AppDelegate");
+            UIApplication.Main(args, null, typeof(AppDelegate));
         }
     }
-}
+}

+ 1 - 1
NetworkStateManagement/Core/MessageDisplayComponent.cs

@@ -110,7 +110,7 @@ namespace NetworkStateManagement
                 if (messages.Count == 0)
                     return;
 
-                Vector2 position = new Vector2(GraphicsDevice.Viewport.Width - 100, 0);
+                Vector2 position = new Vector2(ScreenManager.BASE_BUFFER_WIDTH - 100, 0);
 
                 spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, game.ScreenManager.GlobalTransformation);
 

+ 1 - 2
NetworkStateManagement/Core/Networking/NetworkBusyScreen.cs

@@ -152,8 +152,7 @@ namespace NetworkStateManagement
 			const int vPad = 16;
 
 			// Center the message text in the viewport.
-			Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-			Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
+			Vector2 viewportSize = new Vector2(ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
 			Vector2 textSize = font.MeasureString(message);
 
 			// Add enough room to spin a cat.

+ 1 - 3
NetworkStateManagement/Core/ScreenManager/ScreenManager.cs

@@ -301,12 +301,10 @@ namespace NetworkStateManagement
         /// </summary>
         public void FadeBackBufferToBlack(float alpha)
         {
-            Viewport viewport = GraphicsDevice.Viewport;
-
             spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, GlobalTransformation);
 
             spriteBatch.Draw(blankTexture,
-                             new Rectangle(0, 0, viewport.Width, viewport.Height),
+                             new Rectangle(0, 0, BASE_BUFFER_WIDTH, BASE_BUFFER_HEIGHT),
                              Color.Black * alpha);
 
             spriteBatch.End();

+ 1 - 2
NetworkStateManagement/Core/Screens/BackgroundScreen.cs

@@ -84,8 +84,7 @@ namespace NetworkStateManagement
         public override void Draw(GameTime gameTime)
         {
             SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-            Rectangle fullscreen = new Rectangle(0, 0, viewport.Width, viewport.Height);
+            Rectangle fullscreen = new Rectangle(0, 0, ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
 
             spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, ScreenManager.GlobalTransformation);
 

+ 1 - 2
NetworkStateManagement/Core/Screens/LoadingScreen.cs

@@ -175,8 +175,7 @@ namespace NetworkStateManagement
 				string message = Resources.Loading;
 
 				// Center the text in the viewport.
-				Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-				Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
+				Vector2 viewportSize = new Vector2(ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
 				Vector2 textSize = font.MeasureString(message);
 				Vector2 textPosition = (viewportSize - textSize) / 2;
 

+ 0 - 14
NetworkStateManagement/Core/Screens/MenuEntry.cs

@@ -101,13 +101,6 @@ namespace NetworkStateManagement
         /// </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 (UIUtility.IsMobile)
-            {
-                isSelected = false;
-            }
-
             // When the menu selection changes, entries gradually fade between
             // their selected and deselected appearance, rather than instantly
             // popping to the new state.
@@ -125,13 +118,6 @@ namespace NetworkStateManagement
         /// </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
-            if (UIUtility.IsMobile)
-            {
-                isSelected = false;
-            }
-
             // Draw the selected entry in yellow, otherwise white.
             Color color = isSelected ? Color.Yellow : Color.White;
 

+ 2 - 2
NetworkStateManagement/Core/Screens/MenuScreen.cs

@@ -148,7 +148,7 @@ namespace NetworkStateManagement
                 MenuEntry menuEntry = menuEntries[i];
 
                 // each entry is to be centered horizontally
-                position.X = ScreenManager.GraphicsDevice.Viewport.Width / 2 - menuEntry.GetWidth(this) / 2;
+                position.X = ScreenManager.BASE_BUFFER_WIDTH / 2 - menuEntry.GetWidth(this) / 2;
 
                 if (ScreenState == ScreenState.TransitionOn)
                     position.X -= transitionOffset * 256;
@@ -212,7 +212,7 @@ namespace NetworkStateManagement
             float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
 
             // Draw the menu title centered on the screen
-            Vector2 titlePosition = new Vector2(graphics.Viewport.Width / 2, 80);
+            Vector2 titlePosition = new Vector2(ScreenManager.BASE_BUFFER_WIDTH / 2, 80);
             Vector2 titleOrigin = font.MeasureString(menuTitle) / 2;
             Color titleColor = new Color(192, 192, 192) * TransitionAlpha;
             float titleScale = 1.25f;

+ 1 - 2
NetworkStateManagement/Core/Screens/MessageBoxScreen.cs

@@ -120,8 +120,7 @@ namespace NetworkStateManagement
             ScreenManager.FadeBackBufferToBlack(TransitionAlpha * 2 / 3);
 
             // Center the message text in the viewport.
-            Viewport viewport = ScreenManager.GraphicsDevice.Viewport;
-            Vector2 viewportSize = new Vector2(viewport.Width, viewport.Height);
+            Vector2 viewportSize = new Vector2(ScreenManager.BASE_BUFFER_WIDTH, ScreenManager.BASE_BUFFER_HEIGHT);
             Vector2 textSize = font.MeasureString(message);
             Vector2 textPosition = (viewportSize - textSize) / 2;
 

+ 1 - 1
NetworkStateManagement/Platforms/Android/AndroidManifest.xml

@@ -4,6 +4,6 @@
 	<uses-feature android:glEsVersion="0x00020000" android:required="true" />
 	<application android:label="@string/app_name" android:icon="@drawable/icon" />
 	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-	<uses-permission android:name="android.permission.GET_ACCOUNTS" />
 	<uses-permission android:name="android.permission.INTERNET" />
+	<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
 </manifest>

+ 1 - 1
NetworkStateManagement/Platforms/Android/MainActivity.cs

@@ -5,7 +5,7 @@ using Android.Views;
 
 using Microsoft.Xna.Framework;
 
-namespace NetworkStateManagement
+namespace NetworkStateManagement.Android
 {
     [Activity(
         Label = "@string/app_name",

+ 0 - 0
NetworkStateManagement/Platforms/Android/Program.cs


+ 7 - 0
NetworkStateManagement/Platforms/iOS/Info.plist

@@ -12,5 +12,12 @@
 	<string>NetworkStateManagement</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
+	<key>UISupportedInterfaceOrientations</key>
+    <array>
+        <string>UIInterfaceOrientationLandscapeLeft</string>
+        <string>UIInterfaceOrientationLandscapeRight</string>
+    </array>
+	<key>NSLocalNetworkUsageDescription</key>
+	<string>This app requires access to the local network to find and join multiplayer games.</string>
 </dict>
 </plist>

+ 12 - 3
NetworkStateManagement/Platforms/iOS/Program.cs

@@ -1,13 +1,22 @@
+using Foundation;
 using UIKit;
 
 namespace NetworkStateManagement.iOS
 {
-    public class Application
+    [Register("AppDelegate")]
+    class AppDelegate : UIApplicationDelegate
     {
-        // This is the main entry point of the application.
+        private NetworkStateManagementGame game;
+
+        public override void FinishedLaunching(UIApplication app)
+        {
+            game = new NetworkStateManagementGame();
+            game.Run();
+        }
+
         static void Main(string[] args)
         {
             UIApplication.Main(args, null, typeof(AppDelegate));
         }
     }
-}
+}